Disabling cron after NIM restore


 
Thread Tools Search this Thread
Operating Systems AIX Disabling cron after NIM restore
# 1  
Old 11-03-2014
Disabling cron after NIM restore

Hi Guys,

We normally have a backup and restore nightly on our Prod machines. We do this via customized script and all unattended. The dilemma that I'm having is the disabling of the cron after the restore.

I created a nim script to disable the cron after the restore has been completed. But some of the cron jobs in our Prod that runs every minute can get sneaked out and will sometimes run. The reason for this is that there's a 1 to 2 mins gap once the restore has completed which enables cron normally, and when the nim script to disable cron gets executed.

Is there a way to disable cron even before the restore gets completed? Or is this even possible?

I haven't used fb_script and CUSTOMIZATION_FILE on NIM yet. Not sure if this is the answer to my problem.

Any advise is greatly appreciated.


Regards,
Kaelu
# 2  
Old 11-03-2014
Instead of disabling cron after the restore completes, why not disable cron before the restore starts?
# 3  
Old 11-03-2014
Quote:
Originally Posted by Don Cragun
Instead of disabling cron after the restore completes, why not disable cron before the restore starts?
Hi Don - I don't know how to disable cron before the restore starts, or how to update the mksysb file to disable the cron. Could you tell me how to do that if possible?
# 4  
Old 11-03-2014
You said: "I created a nim script to disable the cron after the restore has been completed." So, since you know how to disable the cron after the restore has been completed, you must also know how to disable the cron at some other time. Use that knowledge to disable the cron before you start the restore instead of after the restore completes!
# 5  
Old 11-03-2014
Maybe a another Idea could be to exclude the crontabs directory or the specific file /var/spool/cron/crontabs in your backup script and install the needed crontabs from another directory (e.g. crontab /backup/crontabs/root).

Regards
Ron
# 6  
Old 11-03-2014
Hi,

Depending on your version of AIX, the process can be a little different when it comes to starting and stopping the cron service. What version are you using?

Regards

Dave
# 7  
Old 11-03-2014
Quote:
Originally Posted by Don Cragun
So, since you know how to disable the cron after the restore has been completed, you must also know how to disable the cron at some other time. Use that knowledge to disable the cron before you start the restore instead of after the restore completes!
I can't do this, once you restored an AIX mksysb, cron is automatically started. This is the nim script resource that I run after the restore has completed in our DR box.

Code:
#!/bin/ksh
#  CUSTOMIZING SCRIPT to set the hostname, disable cron
#export LOGFILE=/`basename $0 .ksh`.$(date +%Y%m%d.%H%M.log)
#exec >${LOGFILE} 2>&1
#echo "\n===========\nStarting `basename $0` at `date`\n===========================\n"
# Change hostname
#chdev -l inet0 -a hostname=drserver
# Update /etc/inittab (but back it up first)
exec 1>/var/log/node_bosinst.log
exec 2>&1
cp /etc/inittab /etc/inittab.bak.$(date +%Y%m%d)
chitab "cron:23456789:off:/usr/sbin/cron"
refresh -s inetd
#echo "\n==============\nCompleting `basename $0` at `date`\n===================\n"
#exit 0




[QUOTE]
Quote:
Originally Posted by -=XrAy=-
Maybe a another Idea could be to exclude the crontabs directory or the specific file /var/spool/cron/crontabs in your backup script and install the needed crontabs from another directory (e.g. crontab /backup/crontabs/root).
Thanks Ron. This is actually my last resort on fixing this. I'm just thinking of any other way of disabling cron in the mksysb or right after the restore without any delay of running cron jobs that runs every minute.

Quote:
Originally Posted by gull04
Hi,

Depending on your version of AIX, the process can be a little different when it comes to starting and stopping the cron service. What version are you using?
7100-03-03-1415
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Problem in communication nim client with nim master

Hello, I have an AIX6.1 machine which is a nim client to my nim master which is also AIX6.1 machine. I had some problem to perform an installation on my client using smit nim . i removed /etc/niminfo file in order to do the initialization again but when i run the command niminit -a name=client... (0 Replies)
Discussion started by: omonoiatis9
0 Replies

2. AIX

NIM Restore hangs at the start

Hello Gurus, I have a couple of questions, I'm trying to do a mksysb restore from backup and it has just hung at the start. RS/6000 Firmware Version TCP05287 (c) Copyright IBM Corp. 2000 All rights reserved. -------------------------------------------------------------------------------... (8 Replies)
Discussion started by: elcounto
8 Replies

3. UNIX for Dummies Questions & Answers

How to Disabling cron for few hours each day

Hi Is there any way to disable cron adhoc ? I want to run a script for every one minute between 04 to 00 hours will the below serves my purpose ? 01 04-00 * * * <your script> (1 Reply)
Discussion started by: rakeshkumar
1 Replies

4. Shell Programming and Scripting

Disabling and enabling the cron

Hi All, Please tell me what is command to disable and enable the cron in unix. Thanks in Advance. Regards, Sindu (5 Replies)
Discussion started by: indira_s
5 Replies

5. AIX

VIO restore from NIM dosen't work

Hello guys I have been trying to restore a VIO server from NIM using the nim_resource.tar file created from the same VIO lpar. The restoration goes fine and after 99% I get the following error 0516-304 putlvodm: Unable to find device id 000b5f62263b70a50000000000000000 in the Device... (1 Reply)
Discussion started by: balaji_prk
1 Replies

6. AIX

Single file restore from NIM backup

Hi, I've recently implemented a NIM backup procedure for 2 virtual AIX5.3 environments running on a JS22 blade server. The images transfer to an old p620 box connected to some old SSA storage, each server backs up a mksysb and a savevg image. Now seeing as this method should be replacing our... (3 Replies)
Discussion started by: thinboyslim
3 Replies

7. AIX

Back up a client NIM from nim master

Hello everyone Im trying to backup a nim client from nim master but I got this message COMMAND STATUS Command: failed stdout: yes stderr: no Before command completion, additional instructions may appear below. 0042-001 nim:... (2 Replies)
Discussion started by: lo-lp-kl
2 Replies

8. AIX

NIM client mksysb restore

Can a NIM client mksysb restore be performed via NIM (smitty nim) without the NIM client machine having the NIM server's IP and hostname in its /etc/hosts file? (10 Replies)
Discussion started by: kah00na
10 Replies

9. AIX

How to backup and restore Linux uisng NIM.

Hi Friends, I've a hard question to ask. I have a NIM server running on AIX 5.3. Now my requirement is that , " From This NIM Server i would like to take the Image of Linux servers ". I mean that using NIM server i should be able to backup / restore the linux Servers. In Simple terms... (3 Replies)
Discussion started by: rdkumarj
3 Replies

10. AIX

migrate NIM server through NIM installation

I try to migrate a NIM server from one server to another. I try to do a mksysb on NIM server restore the NIM server's mksysb to a client through NIM installation shutdown NIM server start newly installed client as NIM server Does anyone do this before? who can give me some suggestion? (1 Reply)
Discussion started by: yanzhang
1 Replies
Login or Register to Ask a Question