Code: Select all
#!/bin/sh
# backup.sh - a primitive backup script
# Purpose: online backup for desktops
# Usage:
# backup.sh /path/to/backups
#
backup_name=system-backup-$(date +"F").cpio.bz2
find / \
! -path "/tmp/*" \
! -path "/sys/*" \
! -path "/proc/*" \
! -path "/home/*" \
! -path "/dev/*" \
! -name "lost+found" \
! -name $backup_name | cpio -o -H newc | bzip2 -c \
> $1/system-backup-$(date +"%F").cpio.bz2
How did this happen? I was not running any updates during the backup - glibc and other system files should have been completely untouched.
P.S. I used cpio instead of tar because the Busybox version of tar on the 13.37 install CD is broken - it doesn't restore symlinks properly. Maybe the Busybox cpio is also broken?