Operating System - HP-UX
1833753 Members
2553 Online
110063 Solutions
New Discussion

Script to run Ignite backup and remove last two weeks backup

 
SOLVED
Go to solution
mohdamir
Frequent Advisor

Script to run Ignite backup and remove last two weeks backup

Dear gurus,
I need your help on how to write a script to run Ignite backup and at the same time delete the last two weeks backup copy. From my understanding, the Ignite script will be run on client and the removal script will be run on the Ignite server, right?

Thanks...
6 REPLIES 6
Shibin_2
Honored Contributor
Solution

Re: Script to run Ignite backup and remove last two weeks backup

For net recovery,

/opt/ignite/bin/make_net_recovery -v -s -n 0 -x inc_entire=vg00 2>&1

For tape recovery there is no retention using script. That's upto you.
Regards
Shibin
mohdamir
Frequent Advisor

Re: Script to run Ignite backup and remove last two weeks backup

Thanks.. Then how if I want to integrate with the email if the backup unsuccessful?
Shibin_2
Honored Contributor

Re: Script to run Ignite backup and remove last two weeks backup

If you want to mail it, then you need to redirect the above to create a log file

/opt/ignite/bin/make_net_recovery -v -s -n 0 -x inc_entire=vg00 2>&1 > /tmp/ignite.log


You need to create another script to check this log file, once it is completed.

grep -i unsuccess /tmp/ignite.log

if [ ${?} -eq 0 ]; then

echo "Subject: Ignite failed on `hostname`" |/usr/bin/mail
Regards
Shibin
wci
Frequent Advisor

Re: Script to run Ignite backup and remove last two weeks backup

Hi

Yes

Or you can add below to the end of make_net_recovery command in the script

if [ $? -eq 0 ]
then
echo "Ignite backup of `hostname` completed successfully" | mailx -s "Ignite backup of `hostname` completed"
else
echo "Please check log file or Ignite backup for more details of the error on `hostname`" | mailx -s "Ignite backup of `hostname` was unsuccessfull"
fi

WCI
rariasn
Honored Contributor

Re: Script to run Ignite backup and remove last two weeks backup

Hi:

The -n option of the make_net_recovery command allows you to retain a fixed number of recovery images on your system, the default being two images. The oldest recovery image is removed when a new recovery image is created and the specified limit is exceeded. For more information, see make_net_recovery(1M).

rgs,
mohdamir
Frequent Advisor

Re: Script to run Ignite backup and remove last two weeks backup

Thanks guys