-1

According to this one https://stackoverflow.com/a/51693399/16705688 2 strings are needed to schedule a cronjob every 36 hours How do I put them to run a command in crontab -e since usually it's 1 string per command

1 Answers1

0

The fields in crontab file represents these things positionally:

min hour day-of-month                 month day-of-week   command
0   0    0,3,6,9,12,15,18,21,24,27,30 *     *             echo I am running
0   12   1,4,7,10,13,16,19,22,25,28   *     *             echo I am running

The hack there is to pre-define when the first one runs at midnight on some days and the 2nd line runs the same command at noon on other days.

By the way, not a very good solution to the original problem, since this doesn't take into account long/short months/leap years etc.

One.Punch.Leon
  • 602
  • 3
  • 10