Created
February 19, 2021 17:31
-
-
Save dolohow/a9d4be1f1259801de25a86cfff313a5d to your computer and use it in GitHub Desktop.
btrfs snapshot + rsync backup
This file contains 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 | |
# Run | |
# chmod +x full_system_backup.sh | |
# touch full_system_backup_exclude | |
# ./full_system_backup.sh SSH_REMOTE | |
btrfs subvolume snapshot -r / /mnt/snapshot | |
mount --bind /boot /mnt/snapshot/boot | |
rsync -aASvPzz --delete --numeric-ids --delete-excluded \ | |
--exclude-from=full_system_backup_exclude \ | |
/mnt/snapshot/ $1 | |
umount /mnt/snapshots/boot | |
btrfs subvolume delete /mnt/snapshot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment