Cron job scheduling for last Saturday of every month at 09:00 AM

Is their any way to schedule a CRON Job, which triggers the script only on last Saturday of the month. Please advise.

задан 7 July 2020 в 13:49

1 ответ

One possibility might be to schedule the job to run every Saturday, but make execution of the actual command conditional on the month one week hence, ex.

0 9 * * 6    [ "$(date +\%b -d 'next week')" = "$(date +\%b)" ] || somecommand

Note that the % character is special in crontabs, and needs to be escaped.

ответ дан 30 July 2020 в 22:12

Другие вопросы по тегам:

Похожие вопросы: