Revision 59 bin/zfs-replica

zfs-replica (revision 59)
214 214
echo "Start incremental replication"
215 215
if [[ "$server" == "" ]]
216 216
then
217
    cmd="$BINZFS send -i $lastsnapshotReplicated $namevolfs@$lastsnaphot | ssh -o BatchMode=yes root@$server $BINZFS recv $namereplica"
218
    echo $cmd
217
    $BINZFS send -i $lastsnapshotReplicated $namevolfs@$lastsnaphot | root@$server $BINZFS recv $namereplica
219 218
    if [[ "$?" == "0" ]]
220 219
    then
221 220
       cpt=0
......
327 326
     exit 1
328 327
 
329 328
  fi
330
  check_lastsnapshotReplica=$(ssh -o BatchMode=yes root@$server $BINZFS list -H -r -t snapshot $namereplica |grep $lastsnapshot|wc -l)
331
  check_currentsnapshotReplica=$(ssh -o BatchMode=yes root@$server $BINZFS list -H -r -t snapshot $namereplica |grep $snaphot2replicate=|wc -l)
329
  if [ "$server" == "" ]
330
  then
331
     check_lastsnapshotReplica=$($BINZFS list -H -r -t snapshot $namereplica |grep $lastsnapshot|wc -l)
332
     check_currentsnapshotReplica=$($BINZFS list -H -r -t snapshot $namereplica |grep $snaphot2replicate=|wc -l)
333
  else
334
     check_lastsnapshotReplica=$(ssh -o BatchMode=yes root@$server $BINZFS list -H -r -t snapshot $namereplica |grep $lastsnapshot|wc -l)
335
     check_currentsnapshotReplica=$(ssh -o BatchMode=yes root@$server $BINZFS list -H -r -t snapshot $namereplica |grep $snaphot2replicate=|wc -l)
336
  fi
332 337
  if [[ $check_lastsnapshotReplica -eq 0 ]]
333 338
  then
334 339
     echo "Incoherence, incremental replication failed : $lastsnapshotReplicated is missing" 1>&2

Also available in: Unified diff