Re: Cron, > 1 month but < 2 months
Hello there,
On Fri, Mar 09, 2012 at 05:09:23AM +0000, T o n g wrote:
> Is there any easy way to schedule a job for a duration that is greater
> than one month but shorter than 2 months? Any duration will do, as long
> as it is easy to schedule.
Easy? Hmmm.
0 12 * * 1 [ $(expr $(/bin/date +\%s) / 60 / 60 / 24 / 7 \% 8) -eq 3 ] && myscript
works for me well enough: runs every Monday at noon and checks whether
another eight weeks have passed, and if so executes myscript. By
adjusting the -eq 3 the starting date for the eight week interval can be
shifted around.
HTH,
Flo
Reply to: