vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Patrick Tonnerre wrote: > Hi, > > is there a way to launch a crontab entry on AIX 5.2.0.0, ie each two > mondays ? > Your best bet is to launch a wrapper script every monday. In the wrapper, choose whether it is an odd or even week and issue the target commands accordingly. The "choose odd or even" can't be from the beginning of the year, or it will not work across year boundaries, so it needs to be based on absolute time. WEEK=`perl -e 'print 1 & int(time/(60*60*24*7))'` This inaccurately sets WEEK to 0 or 1 (currently 1). Better would be to use one of perl's date/time modules, which do leap years, DST, etc. instead of calculating it yourself. --S ** Posted from http://www.teranews.com ** |
| ||||
| On Fri, 09 May 2008 10:13:55 -0400, smallpond <smallpond@juno.com> wrote: >Patrick Tonnerre wrote: >> Hi, >> >> is there a way to launch a crontab entry on AIX 5.2.0.0, ie each two >> mondays ? >> > >Your best bet is to launch a wrapper script every monday. In the >wrapper, choose whether it is an odd or even week and issue the >target commands accordingly. The "choose odd or even" can't be >from the beginning of the year, or it will not work across year >boundaries, so it needs to be based on absolute time. > >WEEK=`perl -e 'print 1 & int(time/(60*60*24*7))'` > >This inaccurately sets WEEK to 0 or 1 (currently 1). Better would >be to use one of perl's date/time modules, which do leap years, >DST, etc. instead of calculating it yourself. >--S That sounds dumb. Are youz some kind of asshole? |