Date: Fri, 08 Mar 2002 07:23:38 +0100 From: Jean-Christophe Cazenave <zenaf@noos.fr> To: Scott Gerhardt <scott@gerhardt-it.com> Cc: FreeBSD <freebsd-questions@FreeBSD.ORG> Subject: Re: Tar Backup Message-ID: <3C8858EA.4A8407@noos.fr> References: <KPEMLBLEMPMHGLJOCDEGEEGPECAA.scott@gerhardt-it.com>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
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
[-- Attachment #2 --]
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
[-- Attachment #3 --]
#!/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
[-- Attachment #4 --]
dump -B 665600 -f /redhat/export/dump.file /
[-- Attachment #5 --]
#!/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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3C8858EA.4A8407>
