blob: 15952c4154436c21f048695ad09212d02b470f31 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
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
dest=root@jausoft.com
logfile=`basename $0 .sh`-$pool_2_$dest.log
#do_zsync_initial $pool $dest >& $logfile &
do_zsync_increment $pool $dest >& $logfile &
disown $!
|