diff options
author | Sven Gothel <[email protected]> | 2013-09-20 21:23:33 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-09-20 21:23:33 +0200 |
commit | 707f4ed0eb3d868dee77b2ad371216c30b48190b (patch) | |
tree | c778698603961768b57a17e2e8cba55a6ec90a88 /backup | |
parent | 0a5fa94c7418519ca72a5c8e28502e6f14370fc1 (diff) |
zsync-jogamp2jausoft.sh: Add incremental zfs backup .. and add comments/documentation
Diffstat (limited to 'backup')
-rw-r--r-- | backup/zsync-jogamp2jausoft.sh | 46 |
1 files changed, 39 insertions, 7 deletions
diff --git a/backup/zsync-jogamp2jausoft.sh b/backup/zsync-jogamp2jausoft.sh index 31fae83..7228137 100644 --- a/backup/zsync-jogamp2jausoft.sh +++ b/backup/zsync-jogamp2jausoft.sh @@ -1,28 +1,60 @@ #! /bin/bash +# +# one_zsync data-set target-snapshot [incremental-start-snapshot] +# function one_zsync() { dset=$1 shift snap=$1 shift - zfs send -R -D jogamp_org/$dset@$snap | ssh [email protected] "zfs receive -v -u -d jausoft_com/backup/jogamp.org" + snap0=$1 + shift + if[ -z "$snap0" ] ; then + zfs send -R -D jogamp_org/$dset@$snap | ssh [email protected] "zfs receive -v -u -d jausoft_com/backup/jogamp.org" + else + zfs send -R -D -I @$snap0 jogamp_org/$dset@$snap | ssh [email protected] "zfs receive -v -u -d jausoft_com/backup/jogamp.org" + fi } + +# +# all_zsync target-snapshot [incremental-start-snapshot] +# function all_zsync() { snap=$1 shift - one_zsync data $snap - one_zsync services $snap - one_zsync system $snap - one_zsync users $snap + snap0=$1 + shift + one_zsync data $snap $snap0 + one_zsync services $snap $snap0 + one_zsync system $snap $snap0 + one_zsync users $snap $snap0 } -function do_zsync() + +# +# do_zsync_initial +# Performs an initial sync of snapshot 'setup_complete' +# +function do_zsync_initial() { all_zsync setup_complete echo DONE } -do_zsync >& zsync-jogamp2jausoft.log & +# +# do_zsync_increment +# Performs an incremental sync from 'setup_complete' up until '20130920' +# +function do_zsync_increment() +{ + all_zsync 20130920 setup_complete + + echo DONE +} + +#do_zsync_initial >& zsync-jogamp2jausoft.log & +do_zsync_increment >& zsync-jogamp2jausoft.log & disown $! |