From owner-freebsd-questions Fri Mar 8 10:18:19 2002 Delivered-To: freebsd-questions@freebsd.org Received: from smtp.noos.fr (claudel.noos.net [212.198.2.83]) by hub.freebsd.org (Postfix) with ESMTP id 5A80637B425 for ; Fri, 8 Mar 2002 10:17:49 -0800 (PST) Received: (qmail 29057290 invoked by uid 0); 8 Mar 2002 18:17:46 -0000 Received: from unknown (HELO bluenote.noos.fr) ([195.132.161.128]) (envelope-sender ) by 212.198.2.83 (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for ; 8 Mar 2002 18:17:46 -0000 Received: from noos.fr (bluenote [127.0.0.1]) by bluenote.cybercable.fr (8.11.6/8.11.1) with ESMTP id g286Nc100640; Fri, 8 Mar 2002 07:23:39 +0100 (CET) (envelope-from zenaf@noos.fr) Message-ID: <3C8858EA.4A8407@noos.fr> Date: Fri, 08 Mar 2002 07:23:38 +0100 From: Jean-Christophe Cazenave X-Mailer: Mozilla 4.79 [en] (X11; U; Linux 2.4.2 i386) X-Accept-Language: en MIME-Version: 1.0 To: Scott Gerhardt Cc: FreeBSD Subject: Re: Tar Backup References: Content-Type: multipart/mixed; boundary="------------3D5A6E5939DF0C330DC5E3E0" Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG This is a multi-part message in MIME format. --------------3D5A6E5939DF0C330DC5E3E0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hello, Why using tar ? In attachment, you will find a short collection of scripts. archive.sh and dump.sh work. I don't remember the status of backup.sh and dump2.sh which should work with few modifications. The main idea is to split the partition to be archived into slices of 650 Mo: that's why afio is used. In that way, it is possible to restore an archive, a.k.a a set of cdroms containing archive1-FreeBSD.afio to archiveN-FreeBSD.afio. Suppose you've got a wy to store mount_ufs and mount_cd9660 and afio. I put thr content of /stand/sysinstall + a lot of /sbin/mount_* and a version of afio statically compiled in a directory /winnt/freebsd. This directory is a FAT partition (not an NTFS one). Simply boot with kern.flp, mfsroot.flp, and enter a tty-4 shell with fixit.flp. The do the following: mkdir /winnt mount /dev/ad0s1 /winnt [or mount_msdos /dev/ad0s1 /winnt] (the disk is supposed to be correctly labelled) newfs -b 4096 /dev/ad0s3 (my partition containing FreeBSD) mount /dev/ad0s3 /mnt cd /mnt mkdir /cdrom /winnt/freebsd/mount_cd9660 -o ro /dev/acd0c /cdrom /winnt/freebsd/afio -ivk /cdrom/* umount /cdrom Do the same procedure for your CDROMs archive2-FreeBSD.afio to archiveN-FreeBSD.afio. Once you have finished: umount /mnt exit (from the tty-4 shell of fixit.flp) In the /stand/sysinstall menu : Configure => do a post install of FreeBSD Fdisk => write to make the loader you have chosen active... I use this kind of archiving for about two or three years. Best regards, Jean-Christophe Cazenave PS: dump.sh works, but I don't easy the recover operation it involves. Scott Gerhardt wrote: > > I'm using tar to do a full system backup using the following command: > > tar -zcvpf /usr/archive/full-backup-`date '+%d-%B-%Y'`.tar.gz \ > --directory / --exclude=mnt --exclude=proc --exclude=cdrom \ > --exclude=usr/ports --exclude /usr/archive . > > What other directories should I exclude? > /usr/src? > > My goal is to do a system dump which can be moved off the machine and > burned to CD. Total including /usr/src is about 450MB. > > Any suggestions to do this better. > > Thanks, > > _________________________________ > > Scott Gerhardt, P.Geo. > Gerhardt Information Technologies > > _________________________________ > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message -- If the hardware is the heart of a computer then the software is its soul (D.A RUSLING, The Linux Kernel) Jean-Christophe CAZENAVE Email: zenaf@noos.fr --------------3D5A6E5939DF0C330DC5E3E0 Content-Type: application/x-sh; name="archive.sh" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="archive.sh" find / -xdev \! \( -path /tmp/\* -o -path /home/\* -o -path /var/tmp/\* \ -o -path /usr/tmp/\* -o -path /usr/ports/distfiles/\* -o -path /export/\* \) -print| afio -s 650m -o /winnt/export/archive.afio --------------3D5A6E5939DF0C330DC5E3E0 Content-Type: application/x-sh; name="backup.sh" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="backup.sh" #!/usr/local/bin/bash number=-2 echo "Archive 1 en cours" find / -xdev \! \( -path /tmp/\* -o -path /proc/\* -o -path /export/\* \) -print | afio -H '/root/Admin/increment $number' -s 650m -o /winnt/export/archive.cpio 2> /dev/null echo "Apres le script number=$number" ls /winnt/export | sort +89 if [ -f /winnt/export/archive.cpio ]; then number=$(($number+1)) mv /winnt/export/archive.cpio /winnt/export/archive$number-`uname -s`.afio echo "Archive $number effectuee" fi --------------3D5A6E5939DF0C330DC5E3E0 Content-Type: application/x-sh; name="dump.sh" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="dump.sh" dump -B 665600 -f /redhat/export/dump.file / --------------3D5A6E5939DF0C330DC5E3E0 Content-Type: application/x-sh; name="dump2.sh" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="dump2.sh" #!/usr/local/bin/bash echo " Nettoyage des archives precedntes d'`uname -s `" rm -rf /redhat/export/archive*-`uname -s`.dump dump -0u -B 665600 -f /redhat/export/archive.dump / number=`ls -l /redhat/export/archive.dump*|wc -l` echo " number= $number" hostname=`uname -s` inc=1 prefix="archive.dump" while [ $inc -le $number ]; do if [ $inc -le 9 ]; then file=${prefix}"00"${inc} else file=${prefix}"0"${inc} fi mv /redhat/export/${file} /export/archive${inc}-${hostname}.dump echo "number= $inc file= $file" inc=$(($inc+1)) done --------------3D5A6E5939DF0C330DC5E3E0-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message