From 9b0b9d480503196b6dc42ce233e67d5492ec76dd Mon Sep 17 00:00:00 2001 From: Alex Steel <130377221+asteel-gsa@users.noreply.github.com> Date: Tue, 4 Jun 2024 13:39:40 -0400 Subject: [PATCH] change pathing for s3 dumps --- .github/workflows/fac-restore-util.yml | 6 +++--- backend/fac-backup-util.sh | 6 +++--- backend/fac-restore-util.sh | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/fac-restore-util.yml b/.github/workflows/fac-restore-util.yml index ba9201f0dd..34fd5e7908 100644 --- a/.github/workflows/fac-restore-util.yml +++ b/.github/workflows/fac-restore-util.yml @@ -18,8 +18,8 @@ on: description: Version for fac backup utility to use (ex. vX.Y.Z) required: true type: string - s3_backup_folder: - description: 'Name of the folder in s3://${BUCKET}/backups/ (ex. sheduled-mm-dd-HH)' + s3_backup_path: + description: 'Name of the folder in s3://${BUCKET}/backups/ (ex. sheduled/mm-dd-HH)' required: false type: string backup_operation: @@ -45,4 +45,4 @@ jobs: cf_password: ${{ secrets.CF_PASSWORD }} cf_org: gsa-tts-oros-fac cf_space: ${{ env.space }} - command: cf run-task gsa-fac -k 7G -m 3G --name restore_util --command "./fac-restore-util.sh ${{ inputs.util_version }} ${{ inputs.backup_operation }} ${{ inputs.s3_backup_folder }}" + command: cf run-task gsa-fac -k 7G -m 3G --name restore_util --command "./fac-restore-util.sh ${{ inputs.util_version }} ${{ inputs.backup_operation }} ${{ inputs.s3_backup_path }}" diff --git a/backend/fac-backup-util.sh b/backend/fac-backup-util.sh index e697e3acda..68331da9c3 100755 --- a/backend/fac-backup-util.sh +++ b/backend/fac-backup-util.sh @@ -33,7 +33,7 @@ if [ "$run_option" == "initial_backup" ]; then GetUtil InstallAWS gonogo "install_aws" - RDSToS3Dump "$db_name" "$backup_s3_name" "initial-$initial_date" + RDSToS3Dump "$db_name" "$backup_s3_name" "initial/$initial_date" gonogo "db_to_s3" RDSToRDS "$db_name" "$backup_db_name" "initial" gonogo "db_to_db" @@ -51,7 +51,7 @@ elif [ "$run_option" == "scheduled_backup" ]; then GetUtil InstallAWS gonogo "install_aws" - RDSToS3Dump "$db_name" "$backup_s3_name" "scheduled-$scheduled_date" + RDSToS3Dump "$db_name" "$backup_s3_name" "scheduled/$scheduled_date" gonogo "db_to_s3" AWSS3Sync "$s3_name" "$backup_s3_name" gonogo "s3_sync" @@ -59,7 +59,7 @@ elif [ "$run_option" == "daily_backup" ]; then GetUtil InstallAWS gonogo "install_aws" - RDSToS3Dump "$db_name" "$backup_s3_name" "daily-$daily_date" + RDSToS3Dump "$db_name" "$backup_s3_name" "daily/$daily_date" gonogo "db_to_s3" AWSS3Sync "$s3_name" "$backup_s3_name" gonogo "s3_sync" diff --git a/backend/fac-restore-util.sh b/backend/fac-restore-util.sh index 60e0f44da3..bf6fd16877 100755 --- a/backend/fac-restore-util.sh +++ b/backend/fac-restore-util.sh @@ -3,7 +3,7 @@ set -e source tools/util_startup.sh version=$1 run_option=$2 -date_of_backup=$3 +path_of_backup=$3 s3_name="fac-private-s3" backup_s3_name="backups" db_name="fac-db" @@ -12,7 +12,7 @@ mkdir backups_tmp && cd backups_tmp || return GetUtil() { curl -x "$https_proxy" -L "https://github.com/GSA-TTS/fac-backup-utility/releases/download/$version/gov.gsa.fac.cgov-util-$version-linux-amd64.tar.gz" -O - tar -xvf gov.gsa.fac.cgov-util-$version-linux-amd64.tar.gz && rm gov.gsa.fac.cgov-util-$version-linux-amd64.tar.gz + tar -xvf "gov.gsa.fac.cgov-util-$version-linux-amd64.tar.gz" && rm "gov.gsa.fac.cgov-util-$version-linux-amd64.tar.gz" } InstallAWS() { ./gov.gsa.fac.cgov-util install_aws @@ -31,7 +31,7 @@ if [ "$run_option" == "s3_restore" ]; then GetUtil InstallAWS gonogo "install_aws" - S3ToRDSTableRestore "$db_name" "$backup_s3_name" "$date_of_backup" + S3ToRDSTableRestore "$db_name" "$backup_s3_name" "$path_of_backup" gonogo "s3_to_db" AWSS3Sync "$backup_s3_name" "$s3_name" gonogo "s3_sync"