Hello,
it is not a good idea to remove this line, this will break the logic, if there is no snapshot
the problem is in the elif above, you have to remove this, because it will stop the backup process, even when ALLOW_VMS_WITH_SNAPSHOTS_TO_BE_BACKEDUP is set to 1
my suggestion would be to put the removed code in an else of the next if statement, i used an exit, to get out, because I've seen no other way
# elif ls "${VMX_DIR}" | grep -q "\-delta\.vmdk" > /dev/null 2>&1; then
# if [ ${ALLOW_VMS_WITH_SNAPSHOTS_TO_BE_BACKEDUP} -eq 0 ]; then
# logger "info" "Snapshot found for ${VM_NAME}, backup will not take place\n"
# VM_FAILED=1
# fi
elif [[ -f "${VMX_PATH}" ]] && [[ ! -z "${VMX_PATH}" ]]; then
if ls "${VMX_DIR}" | grep -q "\-delta\.vmdk" > /dev/null 2>&1; then
if [ ${ALLOW_VMS_WITH_SNAPSHOTS_TO_BE_BACKEDUP} -eq 1 ]; then
logger "info" "Snapshot found for ${VM_NAME}, consolidating ALL snapshots now (this can take awhile) ...\n"
$VMWARE_CMD vmsvc/snapshot.removeall ${VM_ID} > /dev/null 2>&1
else
logger "info" "ERROR: Snapshot found for ${VM_NAME}, backup will not take place\n"
exit 1
fi
fi