ich hab ein script in /volume2/oscam/gbox/ welches sich gbox_check.sh nennt
ich kann dieses script problemlos im terminal ausführen:
cd /volume2/oscam/gbox/
./gbox_check.sh
das funktioniert wunderbar
nun wollte ich dies im crontab hinzufügen, damit es jede minute ausgeführt wird.
login via admin:
sudo -i
vi /etc/crontab
* * * * * root /volume2/oscam/gbox/gbox_check.sh
danach habe ich crond neugestartet
synoservicecfg --restart crond
leider passiert nichts
ich verstehe nicht was ich falsch mache...
gbox_check.sh
der fehler muss wohl in der ersten zeile liegen
if /bin/ps auxw | grep -v grep | grep -w -c "gbox"
wenn ich das cript mit dem "Taks Scheduler" ausführe, habe ich folgenden output
1
Fri May 26 14:31:09 CEST 2017 gbox is running
obwohl gbox nicht läuft
ich kann dieses script problemlos im terminal ausführen:
cd /volume2/oscam/gbox/
./gbox_check.sh
das funktioniert wunderbar
nun wollte ich dies im crontab hinzufügen, damit es jede minute ausgeführt wird.
login via admin:
sudo -i
vi /etc/crontab
* * * * * root /volume2/oscam/gbox/gbox_check.sh
danach habe ich crond neugestartet
synoservicecfg --restart crond
leider passiert nichts
ich verstehe nicht was ich falsch mache...
gbox_check.sh
#!/bin/sh
if /bin/ps auxw | grep -v grep | grep -w -c "gbox"
then
echo `date` "gbox is running"
else
touch /volume2/oscam/gbox/tmp/gbox.kill
sleep 2
killall -9 gbox
rm -rf /volume2/oscam/gbox/tmp/*info* /volume2/oscam/gbox/tmp/*gbox* /volume2/oscam/gbox/tmp/*online* /volume2/oscam/gbox/tmp/*share* /volume2/oscam/gbox/tmp/atack* /volume2/oscam/gbox/tmp/debug*
cd /volume2/oscam/gbox
sleep 5
./gbox &
fi
der fehler muss wohl in der ersten zeile liegen
if /bin/ps auxw | grep -v grep | grep -w -c "gbox"
wenn ich das cript mit dem "Taks Scheduler" ausführe, habe ich folgenden output
1
Fri May 26 14:31:09 CEST 2017 gbox is running
obwohl gbox nicht läuft
Zuletzt bearbeitet: