0

I want it to execute every 29 days at 3am, regardless of what day of the month it is. I suppose if it executes first in 19/sep, the next day will be 18/oct, then 16/nov...

Also, if I run crontab -e today (19/sep), when will be the first execution?

a) 29 days from today

or b) 29/sep?

If the answer is b), is there a way to make it execute immediately or as described in a)?

4
  • 2
    bunch of site like crontab.guru cronmaker.com cron.schlitt.info will probably help you
    – Sirex
    Sep 19, 2019 at 20:29
  • I came here exactly because crontab.guru says "At 03:00 on every 29th day-of-month.". Because the 29th day of a month is always day 29, so it will execute once a month on day 29.
    – Gustavo
    Sep 19, 2019 at 20:36
  • if cron.schlitt.info is correct, the cron job does nothing I'm expecting it to do.
    – Gustavo
    Sep 19, 2019 at 20:40
  • 4
    Consider using a systemd timer instead. Unlike cron these can actually be scheduled for periods such as "every 29 days". Sep 19, 2019 at 20:51

1 Answer 1

5

You can't do what you want to do with cron alone. If you want to use cron you will need to run your application every day and have it work out if it should continue or exit and wait for the next day.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.