crontab condition
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix administration > crontab condition




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    crontab condition  
NKSIII@hotmail.com


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-29-05 12:50 PM

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?






[ Post a follow-up to this message ]



    Re: crontab condition  
Greg Beeker


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-30-05 10:58 PM


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






[ Post a follow-up to this message ]



    Re: crontab condition  
NKSIII@hotmail.com


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-30-05 10:58 PM

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






[ Post a follow-up to this message ]



    Re: crontab condition  
Greg Beeker


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-31-05 01:12 PM


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.






[ Post a follow-up to this message ]



    Re: crontab condition  
Dave Hinz


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-31-05 11:21 PM

On 31 Mar 2005 05:06:29 -0800, Greg Beeker <gbeeker@gmail.com> wrote:
>
> NKSIII@hotmail.com wrote: 
> you 
>
> 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






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 08:22 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register