From 9dc664c0c009b216fa95273286d12c6ed437ee1d Mon Sep 17 00:00:00 2001 From: ptruessel Date: Mon, 21 Oct 2024 15:49:20 +0200 Subject: [PATCH 1/2] Change path of .env --- config/backup/backup.sh | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/config/backup/backup.sh b/config/backup/backup.sh index 40af3ea..e593075 100644 --- a/config/backup/backup.sh +++ b/config/backup/backup.sh @@ -4,17 +4,11 @@ set -a # Load the .env file -PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" -source "$PROJECT_ROOT/.env" +source ../.env # Deactivates the automatic export of variables set +a -# Checks whether the /backup folder exists and creates it if required -if [ ! -d "/backup" ]; then - mkdir -p /backup -fi - # Backup database docker compose -f compose-backup.yml run db_backup scp -i ${SSH_KEY_PATH} /backup/database.tar.gz ${SERVER_USER}@${SERVER_IP}:${REMOTE_BACKUP_PATH} From e5322bdb454b5d21342f5487400bc7723f354952 Mon Sep 17 00:00:00 2001 From: ptruessel Date: Mon, 21 Oct 2024 15:50:20 +0200 Subject: [PATCH 2/2] Check the /backup path --- config/backup/backup.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config/backup/backup.sh b/config/backup/backup.sh index e593075..4f76771 100644 --- a/config/backup/backup.sh +++ b/config/backup/backup.sh @@ -9,6 +9,11 @@ source ../.env # Deactivates the automatic export of variables set +a +# Checks whether the /backup folder exists and creates it if required +if [ ! -d "/backup" ]; then + mkdir -p /backup +fi + # Backup database docker compose -f compose-backup.yml run db_backup scp -i ${SSH_KEY_PATH} /backup/database.tar.gz ${SERVER_USER}@${SERVER_IP}:${REMOTE_BACKUP_PATH}