diff --git a/backup.sh b/backup.sh index 0cb78ce..8072b4d 100755 --- a/backup.sh +++ b/backup.sh @@ -60,31 +60,31 @@ setup_mirror() create_snapshot() { id="`date -I`-`date +%s`" - echo zfs snapshot -r ${BAKRNG_ROOT}@${id} + zfs snapshot -r ${BAKRNG_ROOT}@${id} } send_single_snapshot() { BAKRNG_SEND_SNAPSHOT=`get_latest_snapshot` while read BAKRNG_REMOTE_ADDR BAKRNG_REMOTE_PORT BAKRNG_REMOTE_ROOT; do - echo "zfs send -R ${BAKRNG_ROOT}@${BAKRNG_SEND_SNAPSHOT} | + zfs send -R ${BAKRNG_ROOT}@${BAKRNG_SEND_SNAPSHOT} | ssh -i ~/.ssh/id_rsa \ -o port=${BAKRNG_REMOTE_PORT} ${BAKRNG_REMOTE_ADDR} \ - zfs receive -dvu ${BAKRNG_REMOTE_ROOT}@${BAKRNG_SEND_SNAPSHOT}" + zfs receive -dvu ${BAKRNG_REMOTE_ROOT}@${BAKRNG_SEND_SNAPSHOT} done - # echo $BAKRNG_SEND_SNAPSHOT > "last-snapshot.txt" + echo $BAKRNG_SEND_SNAPSHOT > "last-snapshot.txt" } send_incremental_snapshop() { BAKRNG_SEND_SNAPSHOT=`get_latest_snapshot` while read BAKRNG_REMOTE_ADDR BAKRNG_REMOTE_PORT BAKRNG_REMOTE_ROOT; do - echo "zfs send -R -i `cat last-snapshot.txt` \ + zfs send -R -i `cat last-snapshot.txt` \ ${BAKRNG_ROOT}@${BAKRNG_SEND_SNAPSHOT} | ssh -i ~/.ssh/id_rsa \ -o port=${BAKRNG_REMOTE_PORT} ${BAKRNG_REMOTE_ADDR} \ - zfs receive -dvu ${BAKRNG_REMOTE_ROOT}@${BAKRNG_SEND_SNAPSHOT}" + zfs receive -dvu ${BAKRNG_REMOTE_ROOT}@${BAKRNG_SEND_SNAPSHOT} done - # echo $BAKRNG_SEND_SNAPSHOT > "last-snapshot.txt" + echo $BAKRNG_SEND_SNAPSHOT > "last-snapshot.txt" }