linux – Launching via cron does not work

Question:

OS Ubuntu 16.04 Need to start leafpad with cron at odd minute of the current hour on odd days. I use for November 18 04 hours.

1-59/2 4 */2 1-12 0-7 DISPLAY=:0 leafpad
1-59/2 4 2-31/2 1-12 0-7 DISPLAY=:0 leafpad

But these commands do not work for both 18th and 19th. The following command works (opens leafpad) for both 18th and 19th.

1-59/2 4 1-31/2 1-12 0-7 DISPLAY=:0 leafpad

Please explain my mistake?

Answer:

judging by the content of this answer , even numbers of the month should be indicated like this:

2-30/2

and the odd ones like this:

1-31/2

and, yes, to specify "any month" you don't need to write 1-12 , just * . similarly for specifying "any day of the week": instead of 0-7 , * is also enough.

Scroll to Top