Many thanks for answer, but where can find the cron? Where should I write the CCcam version; I use CCcam221
Would you please explain step by step and thanks in advance!
Regards
kokar
If your cam binary was named CCcam221 then the script would look like
#!/bin/sh
if ps | grep -v grep | grep CCcam221 > /dev/null #Check target is running
then
exit #If target is running, exit the script
else
/etc/init.d/softcam.CCcam221 start #If it wasn't running, start it
fi
Personally I use the "crontab -e" command to configure my cron jobs, but that requires a basic understanding of the Vi editor. You may find it easier to just create a text file named root (not root.txt, just root) containing a line like:
*/5 * * * * /path/to/script/above
or
*/5 * * * * /usr/bin/camcheck
etc...
That'd run the script every 5 minutes to check and restart cam if needed. */1 would check every minute, */2 every 2 minutes, etc... Copy the root file to /etc/cron/crontabs (resulting in /etc/cron/crontabs/root). If you created the file in windows, make sure Windows didn't add a hidden .txt extension. I don't "think" M$ carriage returns would choke the DB, but if the script or cron doesn't want to run, telnet into the box and run the dos2unix command on the relevant files, something like:
dos2unix /etc/cron/crontabs/root
dos2unix /usr/bin/camcheck
For more details on cron use:
http://lmgtfy.com/?q=dreambox+cron+use
--
hemi