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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

umount/mount for tar backup

Status
Not open for further replies.

dickiebird

Programmer
Feb 14, 2002
758
GB
Hi Guys
(I've also posted this in Unix General Discussion)
Given the following info - can you help me, please

Filesystem Total KB free %used iused %iused Mounted on
/dev/hd4 20480 13844 32% 1105 17% /
/dev/hd9var 12288 4784 61% 136 4% /var
/dev/hd2 389120 68864 82% 16989 17% /usr
/dev/hd3 20480 19160 6% 64 1% /tmp
/dev/hd1 45056 30376 32% 681 5% /home
/dev/lv02 4096 3144 23% 74 7% /local_backup
/dev/lvsybback 49152 7948 83% 49 0% /sybback
/dev/logslv 4096 1832 55% 82 8% /logs
/dev/lv03 4096 3240 20% 131 12% /SYSTEM_SCRIPTS
/dev/lv04 45056 38956 13% 87 0% /home/ftp3270
/dev/lv00 118784 18384 84% 3055 9% /runtime
/dev/lv01 155648 25252 83% 842 2% /data
ariel:/program_source 155648 21236 86% - - /program_source
minnie:/data/Y2K/build 1925120 442860 76% - - /data/Y2K/build

/data/Y2K/build is a directory on a remote machine, which I have just mounted
onto my RS6000 (with help from Tek-Tips gurus )

dbird on mickey: /data > ls -lrt
total 88
drwxrwsrwx 2 root sys 512 Jan 14 1997 chemical
drwxrwsrwx 2 root sys 512 Jan 06 1999 spool
drwxr-sr-x 3 root sys 512 Nov 09 1999 system_scripts
drwxrwsrwx 2 root sys 2560 Oct 09 2000 jcl
drwxrwsrwx 12 root sys 512 Feb 08 2001 xmit
drwxrwsrwx 2 root sys 512 Jun 19 2001 sna_sessions
drwxrwsrwx 2 root sys 1024 Apr 26 2002 logfiles
drwxr-sr-x 8 root sys 512 Nov 06 11:47 Y2K
drwxr-sr-x 2 root sys 4608 Nov 07 06:04 pton
drwxrwsrwx 6 root sys 3584 Nov 14 05:50 rje

The problem is that the daily tar backup to tape is filling the tape.
Directory data has to be backed up - but how can I exclude just /data/Y2K/build
from the backup ? It's big ! ( and is allready backed up on the remote machine )
Can I just umount /data/Y2K/build , run my backup , then mount it afterwards ?
TIA ;-) Dickie Bird
Honi soit qui mal y pense
 
You could do it with umount, but another way is to use the -C flag with tar

tar c -C /home -C /SYSTEM_SCRIPT -C ......

you get the idea

you can also do

tar c -C /home FILE1 FILE2 -C .....

To backup individual files from a select filesystem.

But If I were you, I'd forget about tar altogether and use mksysb and savevg

type lsvg at the command prompt to display a list of you volume groups.

mksysb - creates a tape that contains your rootvg, in the event of a disaster you can boot off cd, then just rebuild your system from the mksysb tape. I tend to do a mksysb once a week, but if your / /usr /var filesystems arn't changing much you could do one a month.

savevg - like mksysb but saves your other volume groups, if you have any that is, some people create every thing under their rootvg, which has it's disadvantages.

I've include the script I use below


############### START SCRIPT ###############

#-------------
# Make Mksysb
#-------------

clear
echo "Please Insert a tape in drive 1"
echo &quot;\nPress <RETURN> to continue.....&quot;
read dummy

echo &quot;MksysB started at `date`&quot; >> backup-times.txt
echo &quot;Rewinding Tape&quot;
mt -f /dev/rmt1 rewind

/usr/bin/mksysb -i -X /dev/rmt1.1

yorn=&quot;&quot;
echo &quot;Mksysb Successful&quot; >> backup-times.txt
echo &quot;Mksysb finished at `date`&quot; >> backup-times.txt

echo &quot;Rewinding & Ejecting Tape&quot;
mt -f /dev/rmt1 offline

#----------------------
# Backup Volume Groups
#----------------------

echo &quot;Do you wish to Backup the volume groups ( Y/N )? ..\b\b\c&quot;
read yorn

if [ $yorn = &quot;y&quot; -o $yorn = &quot;Y&quot; ];then

clear
echo &quot;Please Insert a tape in drive 2&quot;
echo &quot;\nPress <RETURN> to continue.....&quot;
read dummy

echo &quot;Volume Group Backup Started at `date`&quot; >> /backup-times.txt
echo &quot;Rewinding Tape&quot;
mt -f /dev/rmt0 rewind

/usr/bin/savevg -f /dev/rmt0.1 -i -X volumegroup1
/usr/bin/savevg -f /dev/rmt0.1 -i -X volumegroup2
/usr/bin/savevg -f /dev/rmt0.1 -i -X volumegroup3
/usr/bin/savevg -f /dev/rmt0.1 -i -X volumegroup
/usr/bin/savevg -f /dev/rmt0.1 -i -X volumegroup
/usr/bin/savevg -f /dev/rmt0.1 -i -X volumegroup
/usr/bin/savevg -f /dev/rmt0.1 -i -X volumegroup
/usr/bin/savevg -f /dev/rmt0.1 -i -X volumegroup
/usr/bin/savevg -f /dev/rmt0.1 -i -X volumegroup


echo &quot;\n\n Backup complete.......&quot;

echo &quot;Volume Group Successful&quot; >> backup-times.txtecho &quot;Volume Group Backup Finished at `date`&quot; >> backup-times.txt
echo &quot;Rewinding & Ejecting Tape&quot;
mt -f /dev/rmt0 offline

############### FINISH SCRIPT #######################

If you have any questions, please feel free to ask

Regards
--
| Mike Nixon
| Unix Admin
| ----------------------------
 
Thanks Mike
We already do a mksysb on a monthly basis - which ignores data directories ( We have restored from it too, on more than one occasion!)
Trying the umount and mount before and after the data backup was successful.
Thanks for your helpful advice.
Regards Dickie Bird
Honi soit qui mal y pense
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top