Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4792

Troubleshooting • Re: Raspberry Pi 6.1.0 OS Cron Job Configuration Issue: Running Twice on Different Dates

$
0
0
Trouble is there isn't an easy answer and without respec'ing crontabs some sort of decision had to be made and I guess this one was inherited from early unix. Taken purely at face value, it's impossible to say if 30 4 1 * 6 means do something on the first of the month but only if it's a Saturday or whether it's first of the month and every Saturday. Much better to pick a rule and enforce it in all cases.
Agreed. I'm guessing that the reasoning behind the chosen rule is for something like backups which you may want to run every Sunday *and* on the first day of the month.

Having two crontab entries for that sort of thing would seem clearer, but could lead to problems on a Sunday which is also the first day of the month with the cron job potentially being triggered twice. The single entry prevents that.

When timings get too complex I just set the job to run every day and have something in the called script to decide on whether it needs to run or not.

Statistics: Posted by rpdom — Sun Mar 10, 2024 9:12 am



Viewing all articles
Browse latest Browse all 4792

Trending Articles