Don't fail the script when there is an error code 1

This commit is contained in:
Dave Conroy
2022-03-18 06:10:33 -07:00
parent 22db6d79a7
commit 179b39e7d5
2 changed files with 9 additions and 9 deletions

View File

@@ -332,8 +332,7 @@ check_exit_code() {
print_info "Backup completed successfully"
;;
* )
print_error "Backup reported errors - Aborting"
exit 1
print_error "Backup reported errors"
;;
esac
}
@@ -422,17 +421,18 @@ move_backup() {
export AWS_DEFAULT_REGION=${S3_REGION}
if [ -f "${S3_CERT_CA_FILE}" ] ; then
print_debug "Using Custom CA for S3 Backups"
s3_ssl=" --ca-bundle ${S3_CERT_CA_FILE}"
s3_ca_cert="--ca-bundle ${S3_CERT_CA_FILE}"
fi
if var_true "${S3_CERT_SKIP_VERIFY}" ; then
print_debug "Skipping SSL verification for HTTPS S3 Hosts"
s3_ssl="${s3_ssl} --no-verify-ssl"
s3_ssl="--no-verify-ssl"
fi
[[ ( -n "${S3_HOST}" ) ]] && PARAM_AWS_ENDPOINT_URL=" --endpoint-url ${S3_PROTOCOL}://${S3_HOST}"
aws ${PARAM_AWS_ENDPOINT_URL} s3 cp ${TEMP_LOCATION}/${target} s3://${S3_BUCKET}/${S3_PATH}/${target} ${s3_ssl} ${S3_EXTRA_OPTS}
aws ${PARAM_AWS_ENDPOINT_URL} s3 cp ${TEMP_LOCATION}/${target} s3://${S3_BUCKET}/${S3_PATH}/${target} ${s3_ssl} ${s3_ca_cert} ${S3_EXTRA_OPTS}
unset s3_ssl
unset s3_ca_cert
rm -rf "${TEMP_LOCATION}"/*."${checksum_extension}"
rm -rf "${TEMP_LOCATION}"/"${target}"
;;

View File

@@ -5,6 +5,9 @@ source /assets/functions/10-db-backup
source /assets/defaults/10-db-backup
PROCESS_NAME="db-backup"
bootstrap_compression
bootstrap_variables
case "${1,,}" in
"now" | "manual" )
DB_DUMP_BEGIN=+0
@@ -15,9 +18,6 @@ case "${1,,}" in
;;
esac
bootstrap_compression
bootstrap_variables
### Container Startup
print_debug "Backup routines Initialized on $(date)"