diff options
author | Sven Gothel <[email protected]> | 2013-09-20 21:42:08 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-09-20 21:42:08 +0200 |
commit | 17680b48d1931c864e86c1e1a0b05c833dbb238b (patch) | |
tree | 9fd50b158213d8a34b5944242824c96fe16245e7 /backup | |
parent | 707f4ed0eb3d868dee77b2ad371216c30b48190b (diff) |
zsync-pool2dest.sh: Renamed from 'zsync-jogamp2jausoft.sh' ; Generalized source pool and ssh destination.
Diffstat (limited to 'backup')
-rw-r--r-- | backup/zsync-jogamp2jausoft.sh | 60 | ||||
-rw-r--r-- | backup/zsync-pool2dest.sh | 83 |
2 files changed, 83 insertions, 60 deletions
diff --git a/backup/zsync-jogamp2jausoft.sh b/backup/zsync-jogamp2jausoft.sh deleted file mode 100644 index 7228137..0000000 --- a/backup/zsync-jogamp2jausoft.sh +++ /dev/null @@ -1,60 +0,0 @@ -#! /bin/bash - -# -# one_zsync data-set target-snapshot [incremental-start-snapshot] -# -function one_zsync() -{ - dset=$1 - shift - snap=$1 - shift - 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 - snap0=$1 - shift - one_zsync data $snap $snap0 - one_zsync services $snap $snap0 - one_zsync system $snap $snap0 - one_zsync users $snap $snap0 -} - -# -# do_zsync_initial -# Performs an initial sync of snapshot 'setup_complete' -# -function do_zsync_initial() -{ - all_zsync setup_complete - - echo DONE -} - -# -# 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 $! diff --git a/backup/zsync-pool2dest.sh b/backup/zsync-pool2dest.sh new file mode 100644 index 0000000..15952c4 --- /dev/null +++ b/backup/zsync-pool2dest.sh @@ -0,0 +1,83 @@ +#! /bin/bash + +# +# one_zsync pool dest data-set target-snapshot [incremental-start-snapshot] +# +function one_zsync() +{ + pool=$1 + shift + dest=$1 + shift + dset=$1 + shift + snap=$1 + shift + snap0=$1 + shift + if[ -z "$snap0" ] ; then + zfs send -R -D $pool/$dset@$snap | ssh $dest "zfs receive -v -u -d jausoft_com/backup/jogamp.org" + else + zfs send -R -D -I @$snap0 $pool/$dset@$snap | ssh $dest "zfs receive -v -u -d jausoft_com/backup/jogamp.org" + fi +} + +# +# all_zsync pool dest target-snapshot [incremental-start-snapshot] +# +function all_zsync() +{ + pool=$1 + shift + dest=$1 + shift + snap=$1 + shift + snap0=$1 + shift + one_zsync $pool $dest data $snap $snap0 + one_zsync $pool $dest services $snap $snap0 + one_zsync $pool $dest system $snap $snap0 + one_zsync $pool $dest users $snap $snap0 +} + +# +# do_zsync_initial pool dest +# Performs an initial sync of snapshot 'setup_complete' +# +function do_zsync_initial() +{ + pool=$1 + shift + dest=$1 + shift + + all_zsync $pool $dest setup_complete + + echo DONE +} + +# +# do_zsync_increment pool dest +# Performs an incremental sync from 'setup_complete' up until '20130920' +# +function do_zsync_increment() +{ + pool=$1 + shift + dest=$1 + shift + + all_zsync $pool $dest 20130920 setup_complete + + echo DONE +} + +pool=jogamp_org + +logfile=`basename $0 .sh`-$pool_2_$dest.log + +#do_zsync_initial $pool $dest >& $logfile & +do_zsync_increment $pool $dest >& $logfile & +disown $! |