A cron job that will never execute A cron job that will never execute unix unix

A cron job that will never execute


If you're still looking for something robust even in the far future, try https://stackoverflow.com/a/13938099/1601531, where I suggest the use of February 31st in crontab entries which are never intended to execute.

0 0 5 31 2 ?


I needed a valid cron schedule (? syntax not working in my system) which resolves real dates, but to be effectively "never". My current best solution was to pick the most recent leap year and see what day Feb 29th fell on. Feb 29 2016 was a Monday, so the next Monday Feb 29 is currently furthest away.

0 0 29 2 1 yields the next 5 triggers as:

02/29/2044 00:00:00Z02/29/2072 00:00:00Z02/29/2112 00:00:00Z02/29/2140 00:00:00Z02/29/2168 00:00:00Z

Not perfect but it'll do.


Comment it out — put # sign in front of it. Very useful, especially if you're afraid you'll forget about your changes by the year 3099.

Another possibility is to make it execute dummy command, like true rm -rf /.