Will H. Backman said the following on 2005-08-17 21:25:

Do you use dump and restore, or are you just giving and example?

What about partition table backup?
I do it using this script below. its proved to be sufficient for a restore, except for re-creating the mysql.sock on recovery. I recall somebody else had a bootable CD with an embedded SSH server, that would actually be pretty handy too...

_*DRP method:*_
boot from official CD. don't install but drop to shell.
use files in $dump/configuration to create disklabel
then, to recover each filesystem, I do:
   newfs /dev/wd0x
   mount /dev/wd0x /mnt
   cd /mnt
   /sbin/restore -vrf 20050626.full.<partition>.dump
& that was enough.

YMMV but at least you can get started.

cheers, scorch
--
out of the frying pan and into the fire



#/bin/sh
echo full dump of var root home usr
echo "==========================================================="

dump=/tmp/backup/`hostname -s`
today=`/bin/date +%Y%m%d`
rm -rf $dump
mkdir -p $dump/configuration
/sbin/chown -R root:wheel $dump
/bin/chmod -R g+rw $dump
cd $dump

echo backing up configuration
echo "==========================================================="
/sbin/disklabel wd0 > configuration/disklabel 2>&1
/bin/cp /etc/fstab configuration/
/bin/cp /etc/host* configuration/
/bin/cp /etc/my* configuration/
/bin/cp /etc/resolv.conf configuration/
/bin/cp /var/run/dmesg.boot configuration/
/bin/df -ih > configuration/df
/bin/tar cpf - /etc configuration | bzip2 -c9 > $today.configuration.tar.bz2

echo backing up mysql
echo "==========================================================="
mysqldump --user root --password='your_pwd_here' --all-databases --verbose --single-transaction --flush-logs=TRUE --compress=TRUE | bzip2 -c9 > $today.full.mysql.bz2

echo backing up core filesystems
echo "==========================================================="

/sbin/dump -0uaf  - /var  | bzip2 > $today.full.var.dump.bz2
/sbin/dump -0uaf  - /     | bzip2 > $today.full.root.dump.bz2
/sbin/dump -0uaf  - /home | bzip2 > $today.full.home.dump.bz2
/sbin/dump -0uaf  - /usr  | bzip2 > $today.full.usr.dump.bz2

echo "==========================================================="
echo dump completed

Reply via email to