Last active
July 28, 2016 14:59
-
-
Save ferki/83ad5ee0578d1b795d4489823a2e7867 to your computer and use it in GitHub Desktop.
full system backup and restore with rsync
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+ /dev/console | |
+ /dev/initctl | |
+ /dev/null | |
+ /dev/zero | |
- /media/* | |
- /mnt/* | |
- /dev/* | |
- /proc/* | |
- /run/* | |
- /sys/* | |
- /tmp/* | |
- /var/cache/* | |
- /var/tmp/* | |
- /usr/portage/* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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