Révision 27
bin/zfs-replica (revision 27) | ||
---|---|---|
131 | 131 |
#* function FULL REPLICATION |
132 | 132 |
#************************************* |
133 | 133 |
function fullreplication { |
134 |
|
|
135 |
parentdataset=$(awk '{ |
|
136 |
n = split($0, t, "/") |
|
137 |
for (i = 0; ++i <= n-1;) |
|
138 |
printf "/"t[i] |
|
139 |
}' <<< $(echo $namereplica)) |
|
140 |
|
|
134 | 141 |
if [[ "$server" == "" ]] |
135 | 142 |
then |
143 |
|
|
144 |
/sbin/zfs list $parentdataset |
|
145 |
if [[ "?" != "0" ]] |
|
146 |
then |
|
147 |
/sbin/zfs create -p $parentdataset |
|
148 |
fi |
|
149 |
|
|
136 | 150 |
/sbin/zfs send $snapshot2replicate | /sbin/zfs recv $namereplica |
137 | 151 |
if [[ "$?" == "0" ]] |
138 | 152 |
then |
... | ... | |
155 | 169 |
checkServerConnection |
156 | 170 |
if [[ "$snapshot2replicate" != "" ]] |
157 | 171 |
then |
172 |
ssh -o BatchMode=yes root@$server /sbin/zfs list $parentdataset |
|
173 |
if [[ "?" != "0" ]] |
|
174 |
then |
|
175 |
ssh -o BatchMode=yes root@$server /sbin/zfs create -p $parentdataset |
|
176 |
fi |
|
177 |
|
|
158 | 178 |
/sbin/zfs send $snapshot2replicate |ssh -o BatchMode=yes root@$server /sbin/zfs recv $namereplica |
159 | 179 |
if [[ "$?" == "0" ]] |
160 | 180 |
then |
Formats disponibles : Unified diff