Created
February 5, 2015 20:15
-
-
Save brcha/adb66e818e0f4dc1721a to your computer and use it in GitHub Desktop.
Snapshot btrfs and backup using zbackup
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/sh | |
# Generate timestamp | |
TIMESTAMP=$(date +'%Y.%m.%d') | |
BACKUP_ROOT=/run/media/brcha/External/backup/perun--home.brcha | |
# Make snapshot | |
pushd /home &> /dev/null | |
sudo btrfs subvolume snapshot -r brcha @snapshot_brcha_${TIMESTAMP} | |
popd &> /dev/null | |
# Run zbackup | |
pushd /home/@snapshot_brcha_${TIMESTAMP} &> /dev/null | |
tar cv --exclude-caches-all --exclude-tag-all=.no_backup --exclude-backups --xattrs --acls --preserve-permissions . \ | |
| zbackup --password-file ~/.config/zbackup_password backup ${BACKUP_ROOT}/backups/backup-${TIMESTAMP} | |
popd &> /dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment