Skip to content

Instantly share code, notes, and snippets.

@ferki
Last active July 28, 2016 14:59
Show Gist options
  • Save ferki/83ad5ee0578d1b795d4489823a2e7867 to your computer and use it in GitHub Desktop.
Save ferki/83ad5ee0578d1b795d4489823a2e7867 to your computer and use it in GitHub Desktop.
full system backup and restore with rsync
#!/bin/bash
source=${1:-/}
destination=${2:-/mnt/backup}
rsync --archive \
--hard-links --human-readable --inplace --numeric-ids \
--delete --delete-excluded --progress \
--exclude-from $source/home/ferki/.backup/filter \
$source $destination
touch $destination/BACKUP
+ /dev/console
+ /dev/initctl
+ /dev/null
+ /dev/zero
- /media/*
- /mnt/*
- /dev/*
- /proc/*
- /run/*
- /sys/*
- /tmp/*
- /var/cache/*
- /var/tmp/*
- /usr/portage/*
#!/bin/bash
source=${1:-/mnt/backup/}
destination=${2:-/mnt/original/}
rsync -a --progress --exclude=BACKUP $source $destination
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment