From c81f4c51fb3ce431d6dd0b915cf1c685e3ff2b04 Mon Sep 17 00:00:00 2001 From: Malin Date: Mon, 16 Feb 2026 19:41:07 +0100 Subject: [PATCH] fix: export AWS credentials so aws cli can locate them The config file sets AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY as shell variables, but aws cli needs them as environment variables. Added explicit export statements in both bc-backup.sh and bc-cleanup.sh. Co-Authored-By: Claude Opus 4.6 --- bc-backup.sh | 5 +++++ bc-cleanup.sh | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/bc-backup.sh b/bc-backup.sh index 737d074..27e27b9 100755 --- a/bc-backup.sh +++ b/bc-backup.sh @@ -107,6 +107,11 @@ S3_TOOL="${S3_TOOL:-awscli}" MAX_RETRIES="${MAX_RETRIES:-3}" CLEANUP_LOCAL="${CLEANUP_LOCAL:-true}" +# Export AWS credentials so aws cli can find them +export AWS_ACCESS_KEY_ID +export AWS_SECRET_ACCESS_KEY +export AWS_DEFAULT_REGION="${AWS_DEFAULT_REGION:-us-east-1}" + # Determine SinceDateTime for incremental mode SINCE_DATETIME="" if [[ "${BACKUP_MODE}" == "incremental" ]]; then diff --git a/bc-cleanup.sh b/bc-cleanup.sh index a3e4dfb..8adf58f 100755 --- a/bc-cleanup.sh +++ b/bc-cleanup.sh @@ -39,6 +39,11 @@ done RETENTION_DAYS="${RETENTION_DAYS:-30}" +# Export AWS credentials so aws cli can find them +export AWS_ACCESS_KEY_ID +export AWS_SECRET_ACCESS_KEY +export AWS_DEFAULT_REGION="${AWS_DEFAULT_REGION:-us-east-1}" + # Calculate cutoff date if [[ "$OSTYPE" == "darwin"* ]]; then CUTOFF_DATE=$(date -u -v-${RETENTION_DAYS}d '+%Y-%m-%dT%H:%M:%SZ')