Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SAVEVG in a backup script

Status
Not open for further replies.

Roomer

Technical User
Oct 1, 2001
100
GB
I currently have, other than rootvg, three volume groups on my system that I wish to save daily with one backup process.

I have written a script that has been working successfully, but when I look at the data saved onto the tape, I can only find the last volume group's information. This suggests to me that the volume group that is last saved has been written over the previous two.

Can anybody please advise me how to perform these saves in a script that will append onto one tape.

Here is an sample from my existing script...

TAPE1=/dev/rmt1
NOREWIND0=/dev/rmt0.1
NOREWIND1=/dev/rmt1.1

daily_bkup()
{
echo "*************************************************************************" >> $logfile
echo "SAVEVG of volume groups USERVG1, USERVG2 & USERVG3 started AT `date`" >> $logfile
echo "*************************************************************************" >> $logfile
echo "" >> $logfile

for vg in uservg1 uservg2 uservg3
do
./usr/bin/savevg -f $NOREWIND1 '-i' '-m' '-X' $vg
done

if [ $? -eq 0 ]
then
echo "*************************************************************************" >> $logfile
echo "SUCCESS: Volume Group Backups completed successfully at `date +%H:%M`" >> $logfile
echo "*************************************************************************" >> $logfile
echo "" >> $logfile
else
echo "*************************************************************************************" >> $logfile
echo "FAIL: Volume Group Backups Failed at `date`" >> $logfile
echo "*************************************************************************************" >> $logfile
echo "" >> $logfile
fi
}
 
Hi,

I don't think you can use the savevg command to backup multiple volume groups
re- quote man page savevg "Although the tape is not bootable, the first three images on the tape are dummy replacements for the images normally found on a bootable tape. The actual system backup is the fourth image"


The other alternative would be to use the backup command to backup all mounted filesystems for e.g.
FS=$(df -k |grep "^/dev" | awk '{print $7}' | sort)

for I in $FS
do
time /usr/sbin/backup -0 -b64 -L 100g -f /dev/rmt0.1 $I 2> ${TMPF}
done


HTH
 
As long as you know where on the tape the dummy images are, surely you can fsf past them to pick up the final one. The script is effectively calling savevg 3 times, rather than passing three vg's to one instance of savevg. No change to the backup script needed, just make sure there is a restore script that takes into account the extras.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top