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
Asked
Active
Viewed 172 times
-1
-
Can you put more clearly how the crontab/s should look like or what's expected. If possible an example – leangaurav Oct 13 '21 at 02:29
-
That answer is suggesting two separate crontab entries – ChrisGPT was on strike Oct 15 '21 at 20:17
1 Answers
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