Last active
April 6, 2018 00:59
-
-
Save tristanseifert/e2ab0e8f7061f32ac57cec998540e707 to your computer and use it in GitHub Desktop.
backup script
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/sh | |
# create snapshot | |
zfSnap -d -s -S -a 2m tank/data | |
# determine latest snapshot | |
BACKUPDIR=$(ls -td /mnt/tank/data/.zfs/snapshot/*/ | sort -r | head -1) | |
echo "Selected $BACKUPDIR for rsync backup..." | |
# invoke rclone | |
rclone sync --transfers=8 --checkers=4 --drive-chunk-size=32768k --exclude-from ~/rclone-tank-exclusions.txt --bwlimit 1M $BACKUPDIR secret: --config=/usr/local/etc/backups/rclone.conf |
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
# ignore disk images | |
*.sparseimage | |
# ignore log files | |
*.log |
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
# /usr/local/etc/backups/rclone.conf | |
# you would generate this config file with rclone's setup wizard | |
# | |
[remote] | |
type = drive | |
client_id = xxxxx | |
client_secret = xxxxx | |
token = {"access_token":"xxxxx","token_type":"Bearer","refresh_token":"xxxxx","expiry":"2018-04-04T18:09:32.141530416-05:00"} | |
[secret] | |
type = crypt | |
remote = remote:fry-backup | |
filename_encryption = standard | |
password = xxxxx | |
password2 = xxxxx |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment