crontab condition - Unix

This is a discussion on crontab condition - Unix ; Has anyone had any luck w/creating a crontab condition? Our primary configuration is a pair of Sun clustered nodes. Since only one node is hosting the production configuration (at any one time), we have been manually commenting / uncommenting crontab ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: crontab condition

  1. crontab condition

    Has anyone had any luck w/creating a crontab condition? Our primary
    configuration is a pair of Sun clustered nodes. Since only one node is
    hosting the production configuration (at any one time), we have been
    manually commenting / uncommenting crontab entries depending on the
    active server. More recently I have been standardising the entries, but
    prefacing each w/a test for a application that would only be running on
    the active node (i.e. pgrep -f applicationname &&
    activenodescript.csh). Although the pgrep only returns a PID when the
    application is present (as expected), the statement is still being
    executed on both the primary and secondary nodes. Any ideas how / why
    this is incorrect?


  2. Re: crontab condition


    NKSIII@hotmail.com wrote:
    > Has anyone had any luck w/creating a crontab condition? Our primary
    > configuration is a pair of Sun clustered nodes. Since only one node

    is
    > hosting the production configuration (at any one time), we have been
    > manually commenting / uncommenting crontab entries depending on the
    > active server. More recently I have been standardising the entries,

    but
    > prefacing each w/a test for a application that would only be running

    on
    > the active node (i.e. pgrep -f applicationname &&
    > activenodescript.csh). Although the pgrep only returns a PID when the
    > application is present (as expected), the statement is still being
    > executed on both the primary and secondary nodes. Any ideas how / why
    > this is incorrect?


    In our AIX HACMP cluster environment we use the following script to
    decide which is the active node before running a backup. The key is
    that the netstat will only allow the active node to show with a 'svc1'
    address.

    netstat -i | grep svc1 > /dev/null
    if [ $? -eq 0 ]
    then
    run_backup
    else
    echo "This is not the Active Node" > tmplog
    fi


  3. Re: crontab condition

    Cheers, Greg!
    I am guessing that you embed that in all the various scripts, or do you
    do something w/i the crontab entry?


  4. Re: crontab condition


    NKSIII@hotmail.com wrote:
    > Cheers, Greg!
    > I am guessing that you embed that in all the various scripts, or do

    you
    > do something w/i the crontab entry?


    Exactly, we embed that code fragment in all the scripts called from
    cron.


  5. Re: crontab condition

    On 31 Mar 2005 05:06:29 -0800, Greg Beeker wrote:
    >
    > NKSIII@hotmail.com wrote:
    >> Cheers, Greg!
    >> I am guessing that you embed that in all the various scripts, or do

    > you
    >> do something w/i the crontab entry?

    >
    > Exactly, we embed that code fragment in all the scripts called from
    > cron.


    Same way we do the "last friday of the month" type things. Run every friday,
    have the script itself decide if it needs to run further than the "is it
    time?" part of the script or not. Much more, well, scriptable, if you
    do the logic within the script.

    Dave Hinz


+ Reply to Thread