Help with Cron pleazzzzzzzzzzzz
Mike Jeays
mike.jeays at rogers.com
Wed Oct 31 06:52:55 PDT 2007
On October 31, 2007 07:58:21 am VeeJay wrote:
> Hello Gurus….
>
>
>
> I am running a status script written in Perl (*status.pl*) and want to have
> it *Always Running*.
>
>
>
> How can I check through CRON that "status.pl" is running and if NO, then
> start the script execution again?
>
>
>
> Please help and advise…
>
>
>
> With a bundle of thanks!
You could write a shell script something like:
#!/bin/bash
ps -ax | grep 'status.pl'
if [ $q -eq 0 ]
then
status.pl
fi
grep will return zero if it finds a line containing 'status.pl', and 1
otherwise.
in crontab, use
* * * * * /full/path/to/script-above
and it will check every minute.
But a better fix would be to find the bug in status.pl that makes it crash!
--
Mike Jeays
http://www.jeays.ca
More information about the freebsd-questions
mailing list