Backups
I'm using duplicity for backups. I'm trying to back up every single machine to milkweed, an old box with a lot of disk. So far so good.
Adding a Box
get the install-backup.sh script on the client end.
- run it and leave the SSH key visible on the screen.
- open a new xterm and ssh to milkweed.
run /root/setup_server.sh clientname (eg ./setup_server.sh edison1 )
- paste the SSH key from the client into the screen (this is a vi session editing the correct authorized_keys file on milkweed)
Restoring A Full System With Duplicity
- partition and mount the empty filesystem
- make a new ssh key to access the duplicity volumes
- make sure duplicity has --numeric-owner patch
use --numeric-owner
use --scp-command "scp -i path-to-identity-file" and --sftp-command "sftp -o IdentityFile=path-to-identity-file".
test with collection-status
use --force to overwrite existing directories, AKA mount points
- make a script of your duplicity command because it will be very long
- run it
- chroot to the new system
- make a /proc,/dev,/dev/shm,/dev/pts and any other missing mountpoints.
KEY=/root/for_dev1_restore
FROM=dev2
TO=dev1
duplicity restore -v4 \
--no-encryption \
--numeric-owner \
--scp-command "scp -i $KEY" \
--sftp-command "sftp -o IdentityFile=$KEY" \
--force \
scp://$FROM@milkweed//home/backups/$FROM/duplicity \
/mnt/$TO
Restoring a Bare-Metal Backup to Xen
- restore backup to disk on Xen host (see above)
- cp -a /dev/mapper/hostname* /mnt/hostname/dev/mapper
- cp -a /dev/hostname /mnt/hostname/dev
- chroot to backup
- mount /proc and /sys
- fix /etc/modprobe.conf like so:
alias eth0 xennet alias scsi_hostadapter xenblk
- check and fix /etc/fstab - look out for vg name
- make sure grub.conf has correct root= value. Watch out for vg in particular
- add console=xvc0 to kernel args in grub.conf
add "co:2345:respawn:/sbin/agetty xvc0 9600 vt100-nav" to /etc/inittab
- in /etc/sysctl.conf set xen.independent_wallclock = 1
- use rpm to remove all kernels
- use yum to install kernel-xen
- this should give a new initrd that should work.. if not, use mkinitrd
Restoring a Single User's Home Dir With Duplicity
duplicity restore scp://edison2@milkweed/duplicity /home/webusrs/jdoe0001 -v4 --file-to-restore home/webusrs/jdoe0001 --no-encryption -t 2009-01-22T12:00:00-08:00 | tee restore.out
When do they do their thing?
Machine |
Time |
Should Be |
Prngrab |
11:30 |
11:30 |
C3po |
11:30 |
11:45 |
Edison1 |
12:00 |
12:00 |
Tintin1 |
12:00 |
12:15 |
Tintin2 |
12:00 |
12:30 |
Zephir1 |
12:10 |
12:45 |
Dev |
12:45 |
1:00 |
Edison2 |
1:00 |
1:15 |
Babar |
1:00 |
1:30 |
Syldavia |
1:15 |
1:45 |
Celeste |
1:35 |
2:00 |
Arthur1 |
1:43 |
2:15 |
Arthur2 |
1:43 |
2:30 |
Marlinsp |
2:00 |
2:45 |
Milkweed |
???? |
3:00 |
