preserve_quota

This commit is contained in:
Milan Meduna 2021-01-08 12:51:33 +01:00
parent b80129b4d9
commit 8ae1f0710b

View file

@ -31,6 +31,7 @@ DATASET_VAR=$(echo "$DATASETS" | grep crypt | grep lxd | grep storage | grep con
DATASET_RECORDSIZE_VAR=$(zfs get recordsize -H -o value "$DATASET_VAR") DATASET_RECORDSIZE_VAR=$(zfs get recordsize -H -o value "$DATASET_VAR")
DATASET_ATIME_VAR=$(zfs get atime -H -o value "$DATASET_VAR") DATASET_ATIME_VAR=$(zfs get atime -H -o value "$DATASET_VAR")
DATASET_RELATIME_VAR=$(zfs get relatime -H -o value "$DATASET_VAR") DATASET_RELATIME_VAR=$(zfs get relatime -H -o value "$DATASET_VAR")
DATASET_QUOTA_VAR=$(zfs get quota -H -o value "$DATASET_VAR")
SNAP_TO_SEND_FIRST_FOR_LATER_CHECK=$(echo "$SNAP_TO_SEND_FIRST") SNAP_TO_SEND_FIRST_FOR_LATER_CHECK=$(echo "$SNAP_TO_SEND_FIRST")
IFS=" IFS="
@ -57,7 +58,7 @@ fi
echo "Sending first snapshot" echo "Sending first snapshot"
echo "Sending "$SNAP_TO_SEND_FIRST"" echo "Sending "$SNAP_TO_SEND_FIRST""
zfs send "$SNAP_TO_SEND_FIRST" | pv | ssh "$DEST_IP" -p $DEST_PORT zfs recv -o recordsize="$DATASET_RECORDSIZE_VAR" -o atime="$DATASET_ATIME_VAR" -o relatime="$DATASET_RELATIME_VAR" "$DEST_ZPOOL"/lxd/storage/containers/"$CONT_VAR" zfs send "$SNAP_TO_SEND_FIRST" | pv | ssh "$DEST_IP" -p $DEST_PORT zfs recv -o recordsize="$DATASET_RECORDSIZE_VAR" -o atime="$DATASET_ATIME_VAR" -o relatime="$DATASET_RELATIME_VAR" -o quota="$DATASET_QUOTA_VAR" "$DEST_ZPOOL"/lxd/storage/containers/"$CONT_VAR"
echo "Sleep 2" echo "Sleep 2"
sleep 2 sleep 2
@ -77,7 +78,7 @@ done
echo "Sending second snapshot" echo "Sending second snapshot"
echo "Sending "$SNAP_TO_SEND_FIRST" to "$SNAP_TO_SEND_SECOND" with -I parameter" echo "Sending "$SNAP_TO_SEND_FIRST" to "$SNAP_TO_SEND_SECOND" with -I parameter"
zfs send -I "$SNAP_TO_SEND_FIRST" "$SNAP_TO_SEND_SECOND" | pv | ssh "$DEST_IP" -p $DEST_PORT zfs recv -o recordsize="$DATASET_RECORDSIZE_VAR" -o atime="$DATASET_ATIME_VAR" -o relatime="$DATASET_RELATIME_VAR" "$DEST_ZPOOL"/lxd/storage/containers/"$CONT_VAR" -F zfs send -I "$SNAP_TO_SEND_FIRST" "$SNAP_TO_SEND_SECOND" | pv | ssh "$DEST_IP" -p $DEST_PORT zfs recv -o recordsize="$DATASET_RECORDSIZE_VAR" -o atime="$DATASET_ATIME_VAR" -o relatime="$DATASET_RELATIME_VAR" -o quota="$DATASET_QUOTA_VAR" "$DEST_ZPOOL"/lxd/storage/containers/"$CONT_VAR" -F
echo "Sleep 2" echo "Sleep 2"
sleep 2 sleep 2
@ -92,7 +93,7 @@ done
echo "Sending third snapshot" echo "Sending third snapshot"
echo "Sending "$SNAP_TO_SEND_SECOND" to "$SNAP_TO_SEND_THIRD"" echo "Sending "$SNAP_TO_SEND_SECOND" to "$SNAP_TO_SEND_THIRD""
zfs send -i "$SNAP_TO_SEND_SECOND" "$SNAP_TO_SEND_THIRD" | pv | ssh "$DEST_IP" -p $DEST_PORT zfs recv -o recordsize="$DATASET_RECORDSIZE_VAR" -o atime="$DATASET_ATIME_VAR" -o relatime="$DATASET_RELATIME_VAR" "$DEST_ZPOOL"/lxd/storage/containers/"$CONT_VAR" -F zfs send -i "$SNAP_TO_SEND_SECOND" "$SNAP_TO_SEND_THIRD" | pv | ssh "$DEST_IP" -p $DEST_PORT zfs recv -o recordsize="$DATASET_RECORDSIZE_VAR" -o atime="$DATASET_ATIME_VAR" -o relatime="$DATASET_RELATIME_VAR" -o quota="$DATASET_QUOTA_VAR" "$DEST_ZPOOL"/lxd/storage/containers/"$CONT_VAR" -F
echo "Sleep 2" echo "Sleep 2"
sleep 2 sleep 2
@ -107,7 +108,7 @@ done
echo "Sending fourth snapshot" echo "Sending fourth snapshot"
echo "Sending "$SNAP_TO_SEND_THIRD" to "$SNAP_TO_SEND_FOURTH"" echo "Sending "$SNAP_TO_SEND_THIRD" to "$SNAP_TO_SEND_FOURTH""
zfs send -i "$SNAP_TO_SEND_THIRD" "$SNAP_TO_SEND_FOURTH" | pv | ssh "$DEST_IP" -p $DEST_PORT zfs recv -o recordsize="$DATASET_RECORDSIZE_VAR" -o atime="$DATASET_ATIME_VAR" -o relatime="$DATASET_RELATIME_VAR" "$DEST_ZPOOL"/lxd/storage/containers/"$CONT_VAR" -F zfs send -i "$SNAP_TO_SEND_THIRD" "$SNAP_TO_SEND_FOURTH" | pv | ssh "$DEST_IP" -p $DEST_PORT zfs recv -o recordsize="$DATASET_RECORDSIZE_VAR" -o atime="$DATASET_ATIME_VAR" -o relatime="$DATASET_RELATIME_VAR" -o quota="$DATASET_QUOTA_VAR" "$DEST_ZPOOL"/lxd/storage/containers/"$CONT_VAR" -F
echo "Sleep 2" echo "Sleep 2"
sleep 2 sleep 2
@ -128,7 +129,7 @@ done
echo "Sending fifth snapshot" echo "Sending fifth snapshot"
echo "Sending "$SNAP_TO_SEND_FOURTH" to "$SNAP_TO_SEND_FIFTH"" echo "Sending "$SNAP_TO_SEND_FOURTH" to "$SNAP_TO_SEND_FIFTH""
zfs send -i "$SNAP_TO_SEND_FOURTH" "$SNAP_TO_SEND_FIFTH" | pv | ssh "$DEST_IP" -p $DEST_PORT zfs recv -o recordsize="$DATASET_RECORDSIZE_VAR" -o atime="$DATASET_ATIME_VAR" -o relatime="$DATASET_RELATIME_VAR" "$DEST_ZPOOL"/lxd/storage/containers/"$CONT_VAR" -F zfs send -i "$SNAP_TO_SEND_FOURTH" "$SNAP_TO_SEND_FIFTH" | pv | ssh "$DEST_IP" -p $DEST_PORT zfs recv -o recordsize="$DATASET_RECORDSIZE_VAR" -o atime="$DATASET_ATIME_VAR" -o relatime="$DATASET_RELATIME_VAR" -o quota="$DATASET_QUOTA_VAR" "$DEST_ZPOOL"/lxd/storage/containers/"$CONT_VAR" -F
if [ $bionic_checker == bionic ] if [ $bionic_checker == bionic ]
then then