Fix mountpoint/canmount properties

This commit is contained in:
thorstenspille 2023-05-10 17:52:01 +02:00
parent 79aaa3a146
commit 2e9ae9c965

View File

@ -158,12 +158,7 @@ for name in "${syncvols[@]}"; do
if [[ $debug == "-v" ]]; then log "[DEBUG] $name - Start initial replication"; fi if [[ $debug == "-v" ]]; then log "[DEBUG] $name - Start initial replication"; fi
IFS=$'\n' IFS=$'\n'
for snap in $($ssh $sshcipher $sshport $source "zfs list -H -t snapshot -o name,type -S creation $name | grep -E \"$snapshot_filter\" | tail -1"); do for snap in $($ssh $sshcipher $sshport $source "zfs list -H -t snapshot -o name -S creation $name | grep -E \"$snapshot_filter\" | tail -1"); do
if [[ $(echo $snap | cut -f2) == "filesystem" ]]; then
mp=-xmountpoint
cm=-xcanmount
fi
snap=$(echo $snap | cut -f1)
log "Start initial replication: $snap => $target/$(echo $name | cut -d'/' -f1)" log "Start initial replication: $snap => $target/$(echo $name | cut -d'/' -f1)"
$ssh $ssh_ipher $sshport $source "zfs send -w -p $debug $snap" | $zfs receive $mp $cm -x $tag -x com.sun:auto-snapshot $debug -dF $target/$(echo $name | cut -d'/' -f1) $ssh $ssh_ipher $sshport $source "zfs send -w -p $debug $snap" | $zfs receive $mp $cm -x $tag -x com.sun:auto-snapshot $debug -dF $target/$(echo $name | cut -d'/' -f1)
done done
@ -173,12 +168,7 @@ for name in "${syncvols[@]}"; do
guid=$($zfs list -H -o guid -s creation -t snapshot $target/$name | tail -1) guid=$($zfs list -H -o guid -s creation -t snapshot $target/$name | tail -1)
last=$($ssh $sshcipher $sshport $source "zfs list -H -o name,guid -t snapshot $name | grep $guid | tail -1 | cut -f1") last=$($ssh $sshcipher $sshport $source "zfs list -H -o name,guid -t snapshot $name | grep $guid | tail -1 | cut -f1")
IFS=$'\n' IFS=$'\n'
for snap in $($ssh $sshcipher $sshport $source "zfs list -H -o name,type,guid -s creation -t snapshot $name | grep -E \"$snapshot_filter\" | grep --after-context=200 $guid | grep -v $guid | cut -f1-2"); do for snap in $($ssh $sshcipher $sshport $source "zfs list -H -o name,guid -s creation -t snapshot $name | grep -E \"$snapshot_filter\" | grep --after-context=200 $guid | grep -v $guid | cut -f1-2"); do
if [[ $(echo $snap | cut -f2) == "filesystem" ]]; then
mp=-xmountpoint
cm=-xcanmount
fi
snap=$(echo $snap | cut -f1)
log "Replicating delta of $last => $snap to $target/$name" log "Replicating delta of $last => $snap to $target/$name"
$ssh $sshcipher $sshport $source "zfs send -w $debug -i $last $snap" | zfs receive $mp $cm -x $tag -x com.sun:auto-snapshot -F $debug $target/$name $ssh $sshcipher $sshport $source "zfs send -w $debug -i $last $snap" | zfs receive $mp $cm -x $tag -x com.sun:auto-snapshot -F $debug $target/$name
last=$snap last=$snap