do_only_snapshot_when_migrate

This commit is contained in:
root 2020-05-16 22:40:13 +02:00
parent 2bbd38efe4
commit 5c82619b34

View file

@ -38,7 +38,7 @@ then
echo "Start move "$CONT_VAR"" echo "Start move "$CONT_VAR""
echo "Creating first snapshot" echo "Creating first snapshot"
for command in $(zfSnap -n -zpool28fix -a 7d "$DATASET_VAR" | grep "$DATASET_VAR") for command in $(zfSnap -n -zpool28fix -a 7d "$DATASET_VAR" | grep snapshot | grep "$DATASET_VAR")
do do
SNAP_TO_SEND_FIRST=$(echo "$command" | awk '{print $3}') SNAP_TO_SEND_FIRST=$(echo "$command" | awk '{print $3}')
echo "Doing "$command"" echo "Doing "$command""
@ -57,7 +57,7 @@ fi
echo "Start move "$CONT_VAR"" echo "Start move "$CONT_VAR""
echo "Creating second snapshot" echo "Creating second snapshot"
for command in $(zfSnap -n -zpool28fix -a 7d "$DATASET_VAR" | grep "$DATASET_VAR") for command in $(zfSnap -n -zpool28fix -a 7d "$DATASET_VAR" | grep snapshot | grep "$DATASET_VAR")
do do
SNAP_TO_SEND_SECOND=$(echo "$command" | awk '{print $3}') SNAP_TO_SEND_SECOND=$(echo "$command" | awk '{print $3}')
echo "Doing "$command"" echo "Doing "$command""
@ -73,7 +73,7 @@ echo "Sleep 2"
sleep 2 sleep 2
echo "Creating third snapshot" echo "Creating third snapshot"
for command in $(zfSnap -n -zpool28fix -a 7d "$DATASET_VAR" | grep "$DATASET_VAR") for command in $(zfSnap -n -zpool28fix -a 7d "$DATASET_VAR" | grep snapshot | grep "$DATASET_VAR")
do do
SNAP_TO_SEND_THIRD=$(echo "$command" | awk '{print $3}') SNAP_TO_SEND_THIRD=$(echo "$command" | awk '{print $3}')
echo "Doing "$command"" echo "Doing "$command""
@ -88,7 +88,7 @@ echo "Sleep 2"
sleep 2 sleep 2
echo "Creating fourth snapshot" echo "Creating fourth snapshot"
for command in $(zfSnap -n -zpool28fix -a 7d "$DATASET_VAR" | grep "$DATASET_VAR") for command in $(zfSnap -n -zpool28fix -a 7d "$DATASET_VAR" | grep snapshot | grep "$DATASET_VAR")
do do
SNAP_TO_SEND_FOURTH=$(echo "$command" | awk '{print $3}') SNAP_TO_SEND_FOURTH=$(echo "$command" | awk '{print $3}')
echo "Doing "$command"" echo "Doing "$command""
@ -109,7 +109,7 @@ echo "Sleep 2"
sleep 2 sleep 2
echo "Creating fifth snapshot" echo "Creating fifth snapshot"
for command in $(zfSnap -n -zpool28fix -a 7d "$DATASET_VAR" | grep "$DATASET_VAR") for command in $(zfSnap -n -zpool28fix -a 7d "$DATASET_VAR" | grep snapshot | grep "$DATASET_VAR")
do do
SNAP_TO_SEND_FIFTH=$(echo "$command" | awk '{print $3}') SNAP_TO_SEND_FIFTH=$(echo "$command" | awk '{print $3}')
echo "Doing "$command"" echo "Doing "$command""