prawnsalad / KiwiIRC

This is **DEPRECATED**! Please go to https://github.com/kiwiirc/kiwiirc
https://kiwiirc.com
GNU Affero General Public License v3.0
891 stars 277 forks source link

Kiwiirc crontab job #871

Closed Pitstopper closed 8 years ago

Pitstopper commented 8 years ago

Hi! In debian 7 (on Raspberyy Pi) i used this script for crontab to run kiwiirc:

!/bin/sh

check=ps aux | grep -v grep | grep -c 'kiwiirc' if [ $check -le "0" ]; then cd /var/www/KiwiIRC && ./kiwi start fi

And crontab -e is looks like: */10 * * * * /var/www/KiwiIRC/autokiwi

But i migrated on Debian 8 and this script is not working anymore. This script is working for handle run, but not work with crontab. And i don't know why. Please help, lead me to the right way.

UPD: in logfile - ./kiwi: 8: ./kiwi: ./server/helpers/launcher.js: Permission denied UPD2: everything works, I was inattentive. Sorry for disturb.

Indjov commented 8 years ago

Hello , I use the following script to me does a very good job.

!/usr/bin/perl

@a=qx{ps x | grep -i kiwiirc}; $b=1;

foreach (@a) {

if ($ =~ /grep/) { $ =~ s/.*/blah/g; }

if ($_ =~ /kiwiirc/) {$b=0;}

}

if ($b == 1) {

print "Starting up\n"; qx{cd /home/user/KiwiIRC/ ; ./kiwi start};

}