| Author | 
		  Message
		 | 
		
		  | rkuma2 | 
		  
		    
			  
				 Posted: Tue Dec 30, 2008 4:31 pm    Post subject: Configmanager backup script | 
				     | 
			   
			 
		   | 
		
		
		   Novice
 
 Joined: 11 Jan 2008 Posts: 20
  
  | 
		  
		    
			  
				Hi All,
 
 
I took the backup of the configuration manger  manually by using these following commands on AIX
 
 
 
mqsistopconfigmgr <configmgr_name> 
 
 
mqsibackupconfigmgr <configmgr_name> -d<backupdirectoryname> -a <archive file name>
 
 
mqsistart configmgr <configmgr_name>
 
 
 
I need  the entire process above  in a shell script to take  configuration manager backup automatically  to run on AIX server.
 
 
I have to run this script weekly once using a crontab.
 
 
Does any one has the configuration manager backup shell script?
 
 
Please help me ASAP
 
 
Thanks in advance
 
 
Rkumar | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | fjb_saper | 
		  
		    
			  
				 Posted: Tue Dec 30, 2008 8:40 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Grand High Poobah
 
 Joined: 18 Nov 2003 Posts: 20768 Location: LI,NY 
  | 
		  
		    
			  
				Talk to your Unix admin.
 
You will need to take particular care about the environment and might want to / need to source the mqsiconfig script first. Make sure to redirect error and output into a file you can check for results ... although I believe cron puts the  sysout and syserr to a mail message being sent to the user executing the cron...
 
 
Have fun   _________________ MQ & Broker admin | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | rkuma2 | 
		  
		    
			  
				 Posted: Tue Jan 13, 2009 4:45 pm    Post subject: Configmgrbackupscript | 
				     | 
			   
			 
		   | 
		
		
		   Novice
 
 Joined: 11 Jan 2008 Posts: 20
  
  | 
		  
		    
			  
				i have executed the following script it runs ok.
 
 
#!/bin/ksh
 
 
# Set HOSTNAME
 
HOSTNAME=`hostname`
 
 
# Set DATE
 
DATE=`date +%F-%H%M%S`
 
 
# Set the home directory for the backup files
 
MQBACKUP=/var/mqm/admin/backups/wmbconfigmgr
 
 
# Set the home directory for the log files
 
MQ_ADMIN_LOG=/var/mqm/admin/logs
 
 
# Get the Configuration Manager 
 
find /var/mqsi/components -name BERNARD -print | cut -f 5 -d "/" > /tmp/configmgr$$
 
cat /tmp/configmgr$$ |
 
 
while read CONFIGMGR_NAME
 
do
 
 
 
#Check to see if the Configuration Manager is running.
 
  NUM_PCS=`ps -ef | grep bip | grep $CONFIGMGR_NAME | wc -l` 
 
 
 
#If the Configuration Manager is running stop. 
 
   if [ "$NUM_PCS" -gt 0  ]  
 
   then
 
 
/usr/opt/IBM/mqsi/6.0/bin/mqsistop $CONFIGMGR_NAME 
 
 
     sleep 10
 
 
#Check to see if the command executed successfully
 
  NUM_PCS=`ps -ef | grep bip | grep $CONFIGMGR_NAME | wc -l`
 
 
#If the Configuration Manager is still running, send a page and exit
 
   if [ "$NUM_PCS" -ne 0 ] ; then
 
   echo "ERROR: $CONFIGMGR_NAME on $HOSTNAME did not stop!" 
 
 
 fi
 
 
fi
 
 
#Perform Backup  
 
   echo "Performing Configuration Manager Backup $CONFIGMGR_NAME on --> $HOSTNAME" 
 
 
/usr/opt/IBM/mqsi/6.0/bin/mqsibackupconfigmgr $CONFIGMGR_NAME -d $MQBACKUP 
 
 
   if [ "$?" -ne 0 ] 
 
   then
 
   echo "Configmgr Backup Failed --> $CONFIGMGR_NAME Backup Failed on $HOSTNAME "
 
 
 fi
 
 
# Start the Configuration Manager.
 
 
    echo "Starting the configuration manager $CONFIGMGR_NAME on $HOSTNAME" 
 
/usr/opt/IBM/mqsi/6.0/bin/mqsistart $CONFIGMGR_NAME 
 
 
sleep 20 
 
 
# Check to see if the command executed successfully
 
   NUM_PCS=`ps -ef | grep bip | grep $CONFIGMGR_NAME | wc -l`  
 
 
 
#If the Configuration Manager is not running, send a page and exit
 
   if [ "$NUM_PCS" -eq 0 ] 
 
     then
 
   echo "ERROR: $CONFIGMGR_NAME on $HOSTNAME did not start!" 
 
 
 fi
 
done
 
 
rm /tmp/configmgr$$
 
 
 
 
but when i run this script in cron tab i got this following error
 
 
 
/usr/opt/IBM/mqsi/6.0/bin/mqsistop[27]: mqsistop.bin:  not found.
 
 
Please respond ASAp
 
 
Thanks
 
RK | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Vitor | 
		  
		    
			  
				 Posted: Wed Jan 14, 2009 12:55 am    Post subject: Re: Configmgrbackupscript | 
				     | 
			   
			 
		   | 
		
		
		    Grand High Poobah
 
 Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA 
  | 
		  
		    
			  
				
   
	| rkuma2 wrote: | 
   
  
	but when i run this script in cron tab i got this following error
 
 
 
/usr/opt/IBM/mqsi/6.0/bin/mqsistop[27]: mqsistop.bin:  not found.
 
 | 
   
 
 
 
PATH isn't set up correctly (obviously!), I imagine mqsiprofile isn't sourced properly or at all in the running context. _________________ Honesty is the best policy.
 
Insanity is the best defence. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | fjb_saper | 
		  
		    
			  
				 Posted: Wed Jan 14, 2009 3:28 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Grand High Poobah
 
 Joined: 18 Nov 2003 Posts: 20768 Location: LI,NY 
  | 
		  
		    
			  
				
   
	| fjb_saper wrote: | 
   
  
	Talk to your Unix admin.
 
You will need to take particular care about the environment and might want to / need to source the mqsiconfig script first. Make sure to redirect error and output into a file you can check for results ... although I believe cron puts the  sysout and syserr to a mail message being sent to the user executing the cron...
 
 
Have fun   | 
   
 
 _________________ MQ & Broker admin | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Vitor | 
		  
		    
			  
				 Posted: Thu Jan 15, 2009 1:26 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Grand High Poobah
 
 Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA 
  | 
		  
		    
			  
				
   
	| fjb_saper wrote: | 
   
  
	
   
	| fjb_saper wrote: | 
   
  
	Talk to your Unix admin.
 
You will need to take particular care about the environment and might want to / need to source the mqsiconfig script first. | 
   
 
 | 
   
 
 
 
 
 
 
Missed that - should have just referred to your post! _________________ Honesty is the best policy.
 
Insanity is the best defence. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | rkuma2 | 
		  
		    
			  
				 Posted: Mon Jan 19, 2009 4:51 pm    Post subject: Configmanager backup script | 
				     | 
			   
			 
		   | 
		
		
		   Novice
 
 Joined: 11 Jan 2008 Posts: 20
  
  | 
		  
		    
			  
				Hi All,
 
 
 
i have set up the PATH correctly and sourced the mqsi profile it is working now.
 
 
Thanks
 
RK | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |