Is it possible to skip a scheduled cron job?
Brad De Vries
devriesbj
Thu Mar 22 07:50:55 PDT 2007
On 3/21/07, James McDonald <james at jamesmcdonald.id.au> wrote:
> I have a cron job which runs at x time every week night is there any
> way of skipping one instance of execution?
I have logic in some of my cron scripts that check for the existence
of a user-created lock file. If that lock file exists, the script
will log/echo it and exit. That way some users can stop a cron job
from running by simply creating the appropriate file.
If you use similar logic with a skip-file than you can accomplish the
same thing. Have the script look for a skip-file, if it exists then
log it, remove it and exit. That way you can put the skip-file out
there and forget about it, it will only cause the next run to be
skipped.
The above is assuming that this is a sporadic event -- occasionally
you want to skip a run -- and it would not be easily controllable
within the crontab entry.
HTH,
Brad.
More information about the Linux-users
mailing list