Crond question about steps - Aix

This is a discussion on Crond question about steps - Aix ; Hi, is there a way to launch a crontab entry on AIX 5.2.0.0, ie each two mondays ? -- Pat...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Crond question about steps

  1. Crond question about steps

    Hi,

    is there a way to launch a crontab entry on AIX 5.2.0.0, ie each two
    mondays ?

    --
    Pat

  2. Re: Crond question about steps

    On Fri, 09 May 2008 11:24:23 +0200, Patrick Tonnerre
    wrote:

    >Hi,
    >
    >is there a way to launch a crontab entry on AIX 5.2.0.0, ie each two
    >mondays ?


    Nope. Can't be done.


  3. Re: Crond question about steps

    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 **

  4. Re: Crond question about steps

    On Fri, 09 May 2008 10:13:55 -0400, smallpond
    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?


+ Reply to Thread