A cron job that will never be completed

Is there a way to create a cron expression in order to not do the job at all. Although I used this expression:

0 0 0 1 1? 3099

The above expression will run in the year 3099. Is there any other way to disable the job.

Thank.

+23
unix cron
Nov 30 '11 at 10:17
source share
4 answers

If you are still looking for something reliable, even in the distant future, try https://stackoverflow.com/a/166268/ where, I suggest using February 31st in crontab entries that are never meant to be executed.

0 0 5 31 2 ? 
+23
Dec 18 '12 at 17:16
source share

Comment on this - put a # sign # front of it. Very useful, especially if you are afraid that you will forget about your changes by 3099.

Another possibility is to execute the dummy command, for example true rm -rf / .

+2
Nov 30 '11 at 10:19
source share

Opening your crontab file and deleting the entry would be an adequate way. Or you can also stitch the executable that is called cronjob into an empty shell script.

Tell us more about your setup, then we'll see ...

0
Nov 30 '11 at 10:20
source share

I have created a duplicate (click here to view) for your question and I agree with your initial proposal. After testing, it seems Quartz will never execute a cron expression with a year above 2300.

0
Dec 12 '12 at 10:40
source share



All Articles