1

We have an Active/Standby pair of AIX 5.3 Unix servers. Business requirement dictates keeping a list of components synchronized between them e.g. Oracle RDBMS using Data Guard and certain OS file & folders which includes /var/spool/cron/crontabs.

Problem with keeping CRON related files sync'd is that they will also run on Standby which we do not want. What are some methods for preventing the jobs from executing on Standby?

My thoughts so far is stopping the "CRON" process (if that's the exact Unix process name for it) but unsure if there's a chance it might get started by a monitor process.

  • Find a way to test the local system for its standby state, then prefix your scripts with that test. – Jeff Schaller Jan 22 at 21:03
2

Cron daemon in AIX is started/restarted via init so its not so trivial to stop it.

But here I find very good idea how to stop cron to execute jobs: With those commands you create backup of cron table/jobs and put empty list of jobs. When need you restore from backup.

crontab -l > /tmp/crontab.saved #backup the crontab
touch /tmp/empty.file #create an empty file
crontab -l /tmp/empty.file #delete all entries by replacing them with the 'contents' of empty.file
#cron is now running but has no entries so it won't do anything
crontab  /tmp/crontab.saved #reload the saved cronjobs
2

Create a file on storage that is mounted on the active node only and not synced. Wrap your jobs in scripts that exit if the file does not exist. Leave cron running on both nodes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.