![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Please help me with the run-away cron jobs | dedema | UNIX for Dummies Questions & Answers | 2 | 09-13-2007 10:43 AM |
| cron jobs not run | robertsnoog | Linux | 4 | 02-13-2007 09:24 AM |
| Cron Jobs | Remi | SUN Solaris | 2 | 01-03-2007 04:12 PM |
| Cron Jobs | lewisoco | SUN Solaris | 6 | 09-04-2005 08:14 AM |
| CRON Jobs | eludlow | UNIX for Dummies Questions & Answers | 4 | 05-28-2004 05:24 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
How to submit cron jobs?
How can I write a script to submit a perl script as a cron job but only have it execute once?
After it has executed once, I would like it to automatically insert itself again into cron. I want to avoid the situation where I schedule a cron job to run once a day, but end up with multiple instances of the cron job because it requires more than 24 hours to execute. Thanks, Siegfried |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
just have your perl script check to see if it is already running. if so then don't run.
|
|
#3
|
|||
|
|||
|
How do I check to see if it is still running?
Let is supposed I set a flag in a database and I clear the flag when the perl script exits. What happens if the perl script access violates and executes before it clears the flag? Then I will never run thinking I am already running! Thanks, Siegfried |
|
#4
|
||||
|
||||
|
Install a signal handler that looks for SIGINT, or whatever, and delete the file there. I don't program for a living so I can't give you expert advice there.
|
|
#5
|
|||
|
|||
|
Just an idea
Put your job in a loop inside a shell script. Trap your error of your perl script in the loop. Put this shell script on cron.
|
|||
| Google The UNIX and Linux Forums |