Skip to content

Commit

Permalink
change pathing for s3 dumps
Browse files Browse the repository at this point in the history
  • Loading branch information
asteel-gsa committed Jun 4, 2024
1 parent a909394 commit 9b0b9d4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/fac-restore-util.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 }}"
6 changes: 3 additions & 3 deletions backend/fac-backup-util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -51,15 +51,15 @@ 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"
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"
Expand Down
6 changes: 3 additions & 3 deletions backend/fac-restore-util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand All @@ -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"
Expand Down

0 comments on commit 9b0b9d4

Please sign in to comment.