mirror of
https://asciireactor.com/o4data/zfs-backup.git
synced 2024-11-21 22:25:06 +00:00
Removed echo gates.
This commit is contained in:
parent
adc473c95f
commit
1d093d39d6
14
backup.sh
14
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"
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user