~johanvandegriff/zfs-backup-pull

bd4a5f60c708a144b33f9f22e632f42408f84224 — Johan Vandegriff 2 years ago 2bcdc4f
removed sudo in favor of zfs allow
1 files changed, 5 insertions(+), 2 deletions(-)

M confuzer-backup.sh
M confuzer-backup.sh => confuzer-backup.sh +5 -2
@@ 16,6 16,9 @@ nextcloud
storj
osbackup"

#need to allow at least receive permission for this script
#sudo zfs allow johanv receive,mount,snapshot tool

echo "Getting list of datasets from the server..." | tee -a "$log"
datasets=`ssh -o MACs=hmac-md5 -p "$port" "$remote" \
  "zfs list" | grep "${remote_pool}/" | cut -d' ' -f1 | cut -d/ -f2`


@@ 70,11 73,11 @@ do
    if [[ -z "$old" ]]; then
        ssh -o MACs=hmac-md5 -p "$port" "$remote" \
            "zfs send -R ${remote_pool}/${dataset}@${new_snapshot}" | \
            pv | sudo zfs recv -Fdu "$local_pool"
            pv | zfs recv -Fdu "$local_pool"
    else
        ssh -o MACs=hmac-md5 -p "$port" "$remote" \
            "zfs send -R -I ${remote_pool}/${dataset}@${old_snapshot} ${remote_pool}/${dataset}@${new_snapshot}" | \
            pv | sudo zfs recv -Fdu "$local_pool"
            pv | zfs recv -Fdu "$local_pool"
    fi
  done
done