HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Cron in MCSG
Operating System - HP-UX
1834434
Members
2459
Online
110067
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2007 04:57 PM
03-04-2007 04:57 PM
I have 2 nodes (active-stanby)MCSG running 4 with packages. During fail over from first node to second node, I need to stop cron in the first node and run the crons in second node.
What is the best solution to cater this cron?
What is the best solution to cater this cron?
I'm Parit Madirono/Parit Betak Boyz
Solved! Go to Solution.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2007 10:38 PM
03-04-2007 10:38 PM
Solution
There seem several solutions likely.
You could pre-create two different versions of crontabs of which you move the one in place to /var/spool/crontabs/ which is applicable for either the case that the package is running on this node or isn't.
This can be executed from within your package's control script.
However, if your SG specific cronjobs are just a few you could also put some logic in the cronjob or their wrapper script like e.g.
cmviewcl -p $PACKAGE|awk '$1==pkg&&$NF==node{exit 9}' pkg=$PACKAGE node=$(uname -n)
(( $? == 9 )) && run_cronjob
You could pre-create two different versions of crontabs of which you move the one in place to /var/spool/crontabs/ which is applicable for either the case that the package is running on this node or isn't.
This can be executed from within your package's control script.
However, if your SG specific cronjobs are just a few you could also put some logic in the cronjob or their wrapper script like e.g.
cmviewcl -p $PACKAGE|awk '$1==pkg&&$NF==node{exit 9}' pkg=$PACKAGE node=$(uname -n)
(( $? == 9 )) && run_cronjob
Madness, thy name is system administration
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2007 11:41 PM
03-04-2007 11:41 PM
Re: Cron in MCSG
The following simple yet elegant solution has been suggested in the
http://ITRC.hp.com Serviceguard forum by several customers.
--------------------------------------------------------------------------------
Run package-related cron jobs on every node in the cluster but use a wrapper
script to test whether the package is running on the current node before
initiating the cron tasks.
For example, each node would have the same cronjob entries:
00 01 * * * /usr/local/bin/hacron packageA /etc/cmcluster/pkgAcrontasks
00 * * * * /usr/local/bin/hacron packageB /etc/cmcluster/pkgBcrontasks
hacron (Highly Available cron) might look something like: -
#!/usr/bin/sh
pkghost=`cmviewcl | grep | awk {'print $5'}`
thishost=`uname -n`
if [ "$pkghost" = "$thishost" ]; then
shift
$*
fi
The wrapper script is passed the name of the package it will check for and
the package-specific task list path. At the cron'd time, the scripted test
verifies the package is running on the node. If it is, the task script is
executed.
http://ITRC.hp.com Serviceguard forum by several customers.
--------------------------------------------------------------------------------
Run package-related cron jobs on every node in the cluster but use a wrapper
script to test whether the package is running on the current node before
initiating the cron tasks.
For example, each node would have the same cronjob entries:
00 01 * * * /usr/local/bin/hacron packageA /etc/cmcluster/pkgAcrontasks
00 * * * * /usr/local/bin/hacron packageB /etc/cmcluster/pkgBcrontasks
hacron (Highly Available cron) might look something like: -
#!/usr/bin/sh
pkghost=`cmviewcl | grep
thishost=`uname -n`
if [ "$pkghost" = "$thishost" ]; then
shift
$*
fi
The wrapper script is passed the name of the package it will check for and
the package-specific task list path. At the cron'd time, the scripted test
verifies the package is running on the node. If it is, the task script is
executed.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP