in reply to Cron Question
Schedule it to start at some time say 1:30pm with a cron entry like the following:
13 30 * * * /path/to/myscript.pl
Have the program print the pid (available in perl as the var $$) to a file like /tmp/myscript.pid and add a second line to cron like:
To kill the app 2 hour later at 3:30pm. Of course you could make the kill fancier if you didn't want an error if the script had finished running...15 30 * * * kill `cat /tmp/myscript.pid`
In case you were not aware you edit cron with the command crontab -e. See man crontab for more details.
-monkfish (The Fishy Monk)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re (tilly) 2: Cron Question
by tilly (Archbishop) on Nov 08, 2001 at 05:41 UTC | |
by blakem (Monsignor) on Nov 08, 2001 at 06:21 UTC | |
by tilly (Archbishop) on Nov 08, 2001 at 07:40 UTC |