--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---
> I need to move over some crontab entries from one
> host to the next when an ha takeover event is
> triggered. I have put together a makeshift script
> called by the ha start script which read those
> entries and puts them in the crontabs of the new
> host. But, is there some automated way of doing
> this?
I'm not sure why you feel this is not automated.
That's the way it works - choose the HACMP events for takeover
and add a pre or post event script to take care of crontab entries, and
AIX will take care to call the scripts each time the events are
triggered...
You can make it as fancy or simple as you please with notification, error
codes, custom events, etc...
mike
In article <7huqee$a73$1...@nnrp1.deja.com>,
stou...@my-dejanews.com wrote:
> I need to move over some crontab entries from one
> host to the next when an ha takeover event is
> triggered. I have put together a makeshift script
> called by the ha start script which read those
> entries and puts them in the crontabs of the new
> host. But, is there some automated way of doing
> this?
>
-JAZZ
--
John Jaszczak
Romac International
Assigned to: Harmonic Systems, Inc.
jjas...@harmonic.com
612-321-4139
stou...@my-dejanews.com wrote in message <7huqee$a73$1...@nnrp1.deja.com>...
#!/bin/ksh
if [[ -a $1 ]]; then
eval exec $@
fi
Crontab entries look like this
0 0 * * * /usr/local/bin/hacron /ha/file/system/script
">>/ha/file/system/script.out"
I keep the scripts I want to run on a file system resource, and sync the
crontab files on each system. This way, the scripts on get run when the
filesystems move.
John Jaszczak wrote in message <7j0fct$aki$1...@news.mr.net>...
#!/bin/ksh
#
# $Header: /usr/local/cvsroot/cluster_sw/usr/local/bin/hacron,v 1.2
1998/12/17 17:43:29 dh3235 Exp $
#
# This script is used to allow cron jobs to run in an HACMP environment.
# The problem is, in an HA environment, a file system belonging to an HA
# resource can exist on either machine. Any commands that need to be
executed
# from cron, on that file system, need to be entered in the crontab entries
# for both machines. Only one machine can have the file system mounted, so
# the machine without the file system will log lots of errors from the cron
# system about the command to run being missing.
#
# To solve this problem, use this script to call the scripts that need to be
# cron'd. This script will check to see if the script to run exists, and if
# so, run it. If the file does not exist, this script exits quietly.
#
# To redirect ouput to the same filesystem that the command lives on,
# enclose the redirection parameters in double quotes. Otherwise, cron
# will complain that it cannot create the output file on a non-existant
# file system. See the 2nd example below.
#
# An example of how to use this is as follows:
#
# 0 1 * * * /usr/local/bin/hacron /prod/ecs/edi/bin/ediarc.ksh -b/prod
# 5 1 * * * /usr/local/bin/hacron /prod/ecs/edi/bin/test 1
">>/prod/ecs/edi/log 2>&1"
#
#
# Revision History:
#
# $Log: hacron,v $
# Revision 1.2 1998/12/17 17:43:29 dh3235
# Added an "eval" statement before the exec. This allows the user to
pass
# as the last argument, a double quoted string containing a
redirection
# string. This keeps cron from complaining if the redirection is to a
non
# existant filesystem on the failover machine.
#
# Revision 1.1 1998/12/11 15:38:29 dh3235
# Initial version.
#
#
############################################################################
if [[ -a $1 ]]; then
eval exec $@
fi
#
Below you wrote that you could tailor the HA start script to copy the cron
files into the proper place. However in my situation I would only want these
cron files copied in if a takeover event was happening, NOT if I was just
stopping and starting HA on my secondary node. The question is , how do I tell
HA to copy these cron files into place ONLY if a takeover has taken place.?
Thanks in advance.
Chris Rees
-JAZZ
--
John Jaszczak
Romac International
Assigned to: Harmonic Systems, Inc.
jjas...@harmonic.com
612-321-4139
chris rees wrote in message <375B86CE...@uk.ibm.com>...
Put the copy command in a "node_down_remote" post-event script. (If you have
more than two nodes in your cluster, you're going to have to do some further
work in that script to see if you're reacting to the failure of the
appropriate node. See the Admin Guide.)
--
______________
Tom Weaver (512) 838 8277, T/L 678-8277
tvweaver@[austin|us|vnet].ibm.com or TVWEAVER at [RTP|RALVM17]