Last active
August 16, 2017 19:37
-
-
Save CroneKorkN/7c2bf6298414143f3877bdd8ecbcdeeb to your computer and use it in GitHub Desktop.
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 | |
host="root@example" | |
date="$(date +%Y-%m-%d_%H-%M)" | |
for d in $(zfs list -o mountpoint); do | |
if [ $d = "MOUNTPOINT" ]; then continue; fi # skip table head | |
from="$from $d" | |
done | |
while true; do | |
rsync -avz --progress --relative $from $host:/backup | |
if [ $? == 0 ]; then break; fi | |
echo $(date +%Y-%m-%d_%H-%M) retrying >> backup_log | |
sleep 10 | |
done | |
ssh $host \""zfs snapshot backup@$date"\" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment