From 5ccbdbc9b5c2d644e7e6f2a9277d002a98d1622e Mon Sep 17 00:00:00 2001 From: Kimmo Mattila Date: Wed, 5 Jun 2024 09:24:30 +0300 Subject: [PATCH] allas-backup fixes --- allas-backup | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/allas-backup b/allas-backup index 425597f..1d52ad7 100755 --- a/allas-backup +++ b/allas-backup @@ -201,8 +201,7 @@ if [[ $mode == "swift" ]]; then fi ### Settings in case of S3 -if [[ $mode == "s3cmd" ]]; then - echo "S3 mode inn use" +if [[ $mode == "s3cmd" ]]; then if [[ -e $HOME/.aws/credentials ]]; then export AWS_DEFAULT_REGION="" export $(grep AWS_ACCESS_KEY_ID $HOME/.aws/credentials) @@ -211,6 +210,12 @@ if [[ $mode == "s3cmd" ]]; then echo "Unable to find S3 credentials for Allas." exit 1 fi + if [[ -z "${OS_PROJECT_NAME}" ]]; then + echo "Allas project not defined!" + echo "Please set environment variable: OS_PROJECT_NAME" + echo "to define the Allas project" + exit 1 + fi bucket_name="${project_label}-s3backup" repository="s3:a3s.fi/${bucket_name}" fi