Operating System - Linux
1829762 Members
7516 Online
109992 Solutions
New Discussion

Re: skip the crontab job for one time

 
SOLVED
Go to solution
peterchu
Super Advisor

skip the crontab job for one time

I have a crontab job it run at the 1st of every month , if I want to skip to run the crontab job at next month ( 1th May ) only , but it run normally at the rest of month , is it possible ? thx
4 REPLIES 4
Stuart Browne
Honored Contributor
Solution

Re: skip the crontab job for one time

Not really, no. You cant exclude a time in a Crontab.

You either have to comment the crontab entry out, or make the routine it runs have a way to postpone it's self.
One long-haired git at your service...
Claudio Cilloni
Honored Contributor

Re: skip the crontab job for one time

your crontab entry is (I guess) something like this:

00 00 1 * *

you can change it so:
00 00 1 1-4,6-12 * *


hope this helps.

ciao
Claudio
Stuart Browne
Honored Contributor

Re: skip the crontab job for one time

.. please note that claudio's solution will skip the first of may for *every* year from then on ..
One long-haired git at your service...
Claudio Cilloni
Honored Contributor

Re: skip the crontab job for one time

Yes, exactly... but you have enough time to undo this change :-)