Cron Expression - Subtraction or Date Offset -
i'm not versed in cron expressions , struggling find out whether feasible. possible create expression every 2nd wednesday of month minus 52 days?
the 2nd wednesday of month our known starting point , want subtract off run on ongoing basis. maybe there smarter way write this?
thanks!
i don't think can directly in cron time specification. running command every sunday (52 days before wednesday sunday) , check if date 52 days future between 8 , 13, inclusive:
0 0 * * 7 date=$(date --date='now+52 days' +\%-d); [ $date -ge 8 -a $date -le 13 ] && command
(note percent signs special in crontabs , need escaped.)
Comments
Post a Comment