@@ -100,7 +100,7 @@ bootstrap_variables() {
100100 ;;
101101 esac
102102
103- if [ "${BACKUP_LOCATION,,}" = "s3" ] || [ "${BACKUP_LOCATION,,}" = "minio" ] ; then
103+ if [ "${BACKUP_LOCATION,,}" = "s3" ] || [ "${BACKUP_LOCATION,,}" = "minio" ] && [ -n "${S3_KEY_ID}" ] && [ -n "${S3_KEY_SECRET}" ] ; then
104104 file_env 'S3_KEY_ID'
105105 file_env 'S3_KEY_SECRET'
106106 fi
@@ -652,8 +652,12 @@ move_dbbackup() {
652652 ;;
653653 "s3" | "minio" )
654654 print_debug "Moving backup to S3 Bucket"
655- export AWS_ACCESS_KEY_ID=${S3_KEY_ID}
656- export AWS_SECRET_ACCESS_KEY=${S3_KEY_SECRET}
655+ if [ -n "${S3_KEY_ID}" ] && [ -n "${S3_KEY_SECRET}" ]; then
656+ export AWS_ACCESS_KEY_ID=${S3_KEY_ID}
657+ export AWS_SECRET_ACCESS_KEY=${S3_KEY_SECRET}
658+ else
659+ print_debug "Variable S3_KEY_ID or S3_KEY_SECRET is not set. Please ensure sufficiant IAM role is assigned."
660+ fi
657661 export AWS_DEFAULT_REGION=${S3_REGION}
658662 if [ -f "${S3_CERT_CA_FILE}" ] ; then
659663 print_debug "Using Custom CA for S3 Backups"
@@ -809,7 +813,7 @@ sanity_test() {
809813 ;;
810814 esac
811815
812- if [ "${BACKUP_LOCATION,,}" = "s3" ] || [ "${BACKUP_LOCATION,,}" = "minio" ] ; then
816+ if [ "${BACKUP_LOCATION,,}" = "s3" ] || [ "${BACKUP_LOCATION,,}" = "minio" ] && [ -n "${S3_KEY_ID}" ] && [ -n "${S3_KEY_SECRET}" ] ; then
813817 sanity_var S3_BUCKET "S3 Bucket"
814818 sanity_var S3_PATH "S3 Path"
815819 sanity_var S3_REGION "S3 Region"
@@ -827,6 +831,7 @@ setup_mode() {
827831 if var_true "${MANUAL_RUN_FOREVER}" ; then
828832 mkdir -p /etc/services.d/99-run_forever
829833 cat <<EOF > /etc/services.d/99-run_forever/run
834+
830835#!/bin/bash
831836while true
832837do
0 commit comments