Re: Help with Cron pleazzzzzzzzzzzz
- From: John Nielsen <john@xxxxxxxxxxxx>
- Date: Wed, 31 Oct 2007 10:02:53 -0400
Quoting Mike Jeays <mike.jeays@xxxxxxxxxx>:
On October 31, 2007 07:58:21 am VeeJay wrote: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...
You could write a shell script something like:
A couple nits:
#!/bin/bash
#!/bin/sh
ps -ax | grep 'status.pl'
This should probably be something like "ps -ax | grep 'status.pl' | grep -v grep" so you don't get false positives from the grep process itself.
JN
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
_______________________________________________
freebsd-questions@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@xxxxxxxxxxx"
_______________________________________________
freebsd-questions@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@xxxxxxxxxxx"
- Follow-Ups:
- Re: Help with Cron pleazzzzzzzzzzzz
- From: RW
- Re: Help with Cron pleazzzzzzzzzzzz
- References:
- Help with Cron pleazzzzzzzzzzzz
- From: VeeJay
- Re: Help with Cron pleazzzzzzzzzzzz
- From: Mike Jeays
- Help with Cron pleazzzzzzzzzzzz
- Prev by Date: Re: Primary group and parent dir
- Next by Date: Re: ssh
- Previous by thread: Re: Help with Cron pleazzzzzzzzzzzz
- Next by thread: Re: Help with Cron pleazzzzzzzzzzzz
- Index(es):
Relevant Pages
|
|