Originally posted by: unixgrl
If you are trying to create a multi-server environment where only one system can run the app at a time, the app should be smart enough to figure out if it is already running. For example, it should have a start script that would move the crontab in place if it can't ping the other servers.
The same concept holds true if you use clustering software. With HACMP or VCS, you'd have an application start script that would start the app running. If the system crashes, the app would automatically start somewhere else. Normally, you wouldn't use cron to run your app but if that's what you need, make a wrapper script with the intelligence to figure out if it should be running. If so, have it copy in the correct crontab.
If you don't use any clustering software, then the script running from cron needs to have some way of knowing whether it should run or exit. It is up to the app people to figure that out. (maybe they look for a mounted filesystem, ping the other server, look for a lockfile, etc)
The other way to do this is to have an application IP that moves from system to system. Create an IP for example of "myappip". Then have that IP only be up on one system at a time. Make sure the app only talks to that IP and that you can swing traffic with clustering software or some kind of network routing application.
HACMP, Tivoli, & Veritas cluster server all provide failover capabilities for a price.
#AIX-Forum