From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f8c9b,5531b16d7574c73c X-Google-Attributes: gidf8c9b,public X-Google-Thread: 10b612,5531b16d7574c73c X-Google-Attributes: gid10b612,public X-Google-Thread: fee84,5531b16d7574c73c X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1993-07-26 06:32:40 PST Xref: gmd.de comp.unix.ultrix:10245 comp.unix.osf.osf1:687 comp.unix.questions:19108 Path: gmd.de!xlink.net!howland.reston.ans.net!noc.near.net!uunet!tis.com!mjr From: mjr@tis.com (Marcus J. Ranum) Newsgroups: comp.unix.ultrix,comp.unix.osf.osf1,comp.unix.questions Subject: Re: Remote backup using tar? Date: 26 Jul 1993 13:23:34 GMT Organization: Trusted Information Systems, Inc. Message-ID: <230lsm$d9l@sol.TIS.COM> References: <1993Jul25.170846.11585@desire.wright.edu> NNTP-Posting-Host: otter.tis.com ejones@desire.wright.edu (Ed Jones) writes: >I have several unix boxes, DEC3400s and DECstation 5200s, that I want >to backup the file systems to an Exabyte 8mm drive on the DECstation. >I want to use tar rather than dump. So, how do I do a backup of file systems >on the Alpha to a tape drive on the DECstation using tar? Thanks >for the help. Get gnu tar (on various FTP servers) and use it combined with find. gnu tar's nice since you can specify a list of input files to take. It also can talk to rmt(8) on remote machines, just like rdump/rrestore. A trick I use for doing incrementals is to build a file list using find -newer to get a list of files since the last dump. I then prepend that to itself and use it as the dump index. My backup script is appended below - it could be fancier but it works. I use rmtwrite instead of gnu tar's built in rmt code because I'm having it talk to a tape server on a different port, rather than invoking rmt(8) via rsh. mjr. ----- #!/bin/sh BIN=/usr/local/etc/backup LOGS=/logs/backup FEXT=`date +%m.%d.%y` TAPE=hilo.tis.com:tape LAST=$LOGS/lastdump #we build a file containing a list of files to copy out. #the first thing in that file is itself. heh. rm -f $LOGS/files.$FEXT echo $LOGS/files.$FEXT > $LOGS/files.$FEXT # build the list # default is to do everything that changed since yesterday # if given a parameter, store everything (level 0 dump) rm -f $LOGS/back.$$ if [ $# -eq 1 ] ; then find / -print >> $LOGS/files.$FEXT 2> $LOGS/back.$$ else find / -newer $LAST -print >> $LOGS/files.$FEXT 2> $LOGS/back.$$ fi # dump the files now $BIN/pdtar -D -c -v -f - -T $LOGS/files.$FEXT | \ $BIN/rmtwrite -b 20480 -f $TAPE -p 7777 2> $LOGS/back.$$ if [ $? -ne 0 ]; then ( echo "dump failed!" cat $LOGS/back.$$ ) | /usr/ucb/mail -s dump root exit 1 fi date > $LAST compress -f $LOGS/files.$FEXT rm -f $LOGS/back.$$ exit 0 -- C++ -> C :: cancer -> lung