From 9afb4a4f35253d02eceb6520235b6907877cfdcd Mon Sep 17 00:00:00 2001 From: Pablo Sarria Date: Fri, 6 Mar 2020 14:55:08 +0100 Subject: [PATCH] Arreglamos sentencia de control y bucle El -z necesita negarse para entrar en el bucle de chequeo, creacion y envio del snapshot. Incluye el resto de sentencias de control if dentro de la sentencia de control if inicial para que tenga sentido el resto de acciones --- zonebackuptozone.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/zonebackuptozone.sh b/zonebackuptozone.sh index bf6bebb..6d0573c 100755 --- a/zonebackuptozone.sh +++ b/zonebackuptozone.sh @@ -103,18 +103,18 @@ echo "Looking for addtional datasets in ${UUID}..." DATASET=`vmadm get ${UUID} | json datasets.0 | sed 's/zones\///' | tr -d '\n'` echo "done." -if [ -z "${DATASET}" ]; then +if [ ! -z "${DATASET}" ]; then check_snap ${DATASET} -fi -if [ $? -ne 0 ]; then - create_snap ${DATASET} -else - echo "Snapshot of ${DATASET} already available" - echo "Skipping create snapshot..." -fi + if [ $? -ne 0 ]; then + create_snap ${DATASET} + else + echo "Snapshot of ${DATASET} already available" + echo "Skipping create snapshot..." + fi -send_snap ${DATASET} + send_snap ${DATASET} +fi # we send the config