Operating System - HP-UX
1833863 Members
2013 Online
110063 Solutions
New Discussion

need shell script to backup HPUX SAS913 contents and metadata

 
SOLVED
Go to solution
Jan Shu
Regular Advisor

need shell script to backup HPUX SAS913 contents and metadata

Hi All,

I have a production SAS9.1.3 DI server running on a HPUX 11.23 Itanium server. I am looking for a shell script to do the following steps automatically in a cron job at 10PM EDT daily. Can you please help?

1. stop 3 SAS processes
/sas/MetadataServer/MetadataServer.sh stop &
/sas/ObjectSpawner/ObjectSpawner.sh stop &
/sas/ConnectServer/ConnectServer.sh stop &

2. tar 5 sas file systems (only 10GB total) to /sasbackup/bak/ directory

3. start 3 SAS processes
/sas/MetadataServer/MetadataServer.sh start &
/sas/ObjectSpawner/ObjectSpawner.sh start &
/sas/ConnectServer/ConnectServer.sh start &

Thank you.

Best Regards,
Jan Shu


3 REPLIES 3
Basheer_2
Trusted Contributor

Re: need shell script to backup HPUX SAS913 contents and metadata

Hi Jan,

Lets say your script name is bakup_daily.ksh
in /usr/local/bin
This script has your steps 1 thru 3

Add this to Cron.
crontab -e
00 22 * * * /usr/local/bin/bakup_daily.sh >> /usr/local/bin/bakup_daily.log 2>&1

A. Clay Stephenson
Acclaimed Contributor
Solution

Re: need shell script to backup HPUX SAS913 contents and metadata

When you start processes in backgrond, it is a very good idea to issue a wait so that execution in the parent shell does not continue until all the background processes complete:

e.g.

/sas/MetadataServer/MetadataServer.sh stop &
/sas/ObjectSpawner/ObjectSpawner.sh stop &
/sas/ConnectServer/ConnectServer.sh stop &
wait
tar ...

While issueing all the stops in the background is a good idea so that the 3 can run simultaneously, you normally want the files stable when the tar begins --- that's what the wait does.


If it ain't broke, I can fix that.
Jan Shu
Regular Advisor

Re: need shell script to backup HPUX SAS913 contents and metadata

Thanks for your help. I should give both of you 10 points for the fast reply.

Regards,
Jan Shu