Path: utzoo!mnetor!uunet!husc6!mailrus!ames!ncar!oddjob!matt From: matt@oddjob.UChicago.EDU ("Don't even know my real name!") Newsgroups: comp.unix.wizards Subject: Re: Disk to disk copies Message-ID: <14734@oddjob.UChicago.EDU> Date: 5 May 88 14:57:15 GMT References: <13119@brl-adm.ARPA> <77@tarkus.UUCP> <346@cloud9.UUCP> <3149@saturn.ucsc.edu> Organization: Department of Entropy Lines: 62 haynes@ucscc.UCSC.EDU (Jim Haynes) writes: ) We have a habit of copying the root to a spare partition ) every night [with dd] ... I sya, the way to back up your root partition is with rdist. After all, the root and swap areas or compiled in to a configured vmunix, so you don't want the backup drive's vmunix (nor /etc/fstab) to be identical to the primary drives. I do a nightly: ================ from /usr/adm/daily: if [ -d /backuproot/lost+found ]; then echo "Running rdist:" date >> /usr/adm/rdist-errs rdist -f /usr/local/lib/Distfile backuproot 2>&1 | \ tee -a /usr/adm/rdist-errs else if [ -d /bentuproot/lost+found ]; then echo "Running reverse rdist:" date >> /usr/adm/rdist-errs rdist -f /usr/local/lib/Distfile reversebackup 2>&1 | \ tee -a /usr/adm/rdist-errs else echo "/backuproot not mounted -- skipping rdist" fi fi ================ Either the backup root partition is mounted on /backuproot or, if we are running on the backup root, the primary root is mounted on /bentuproot (if mounted at all). ================ /usr/local/lib/Distfile: ROOTFILES = ( /.cshrc /.login /.plan /.profile /.rhosts /PhoneNumbers /Rates /bin /boot /private /etc /kadb /lib /mbox /stand /sys /tftpboot /genvmunix /vmunix* ) # It's a pity we can't rdist /dev ! EXROOT = ( /vmunix /etc/fstab /etc/rc.dump ) ROOTSPECIAL = ( /vmunix.xy2 ) ETCSPECIAL = ( /etc/fstab.xy2 /etc/rc.dump.xy2 ) backuproot: ${ROOTFILES} -> oddjob install -w -R /backuproot ; except ${EXROOT} ; special ${ROOTSPECIAL} "name=/backuproot/`basename $FILE .xy2` ; rm $name; ln $name.xy2 $name"; special ${ETCSPECIAL} "name=/backuproot/etc/`basename $FILE .xy2` ; rm $name; ln $name.xy2 $name"; REVROOTSPECIAL = ( /vmunix.xy0 ) REVETCSPECIAL = ( /etc/fstab.xy0 /etc/rc.dump.xy0 ) reversebackup: ${ROOTFILES} -> oddjob install -w -R /bentuproot ; except ${EXROOT} ; special ${REVROOTSPECIAL} "name=/bentuproot/`basename $FILE .xy0` ; rm $name; ln $name.xy0 $name"; special ${REVETCSPECIAL} "name=/bentuproot/etc/`basename $FILE .xy0` ; rm $name; ln $name.xy0 $name"; ================ Matt Crawford