Skip to content

Commit

Permalink
Expand the backup operation commands (#4499)
Browse files Browse the repository at this point in the history
  • Loading branch information
asteel-gsa authored Dec 3, 2024
1 parent 82691a8 commit d87d9df
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/fac-backup-util.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ on:
options:
- 'initial_backup'
- 'deploy_backup'
- 'on_demand_backup'
jobs:
fac-backup:
name: Perform Database Backup
Expand Down
13 changes: 13 additions & 0 deletions backend/fac-backup-util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ db_name="fac-db"
backup_db_name="fac-snapshot-db"
initial_date=$(date +%Y%m%d%H%M)
scheduled_date=$(date +%m-%d-%H)
on_demand_date=$(date +%m-%d-%H)
daily_date=$(date +%m-%d)
mkdir tmp && cd tmp || return

Expand Down Expand Up @@ -65,6 +66,18 @@ elif [ "$run_option" == "scheduled_backup" ]; then
gonogo "db_to_s3"
AWSS3Sync "$s3_name" "$backup_s3_name"
gonogo "s3_sync"
elif [ "$run_option" == "on_demand_backup" ]; then
GetUtil
InstallAWS
gonogo "install_aws"
RowCount "$db_name"
gonogo "row_count"
RDSToS3Dump "$db_name" "$backup_s3_name" "on-demand/$on_demand_date"
gonogo "db_to_s3"
RDSToRDS "$db_name" "$backup_db_name" "backup"
gonogo "db_to_db"
AWSS3Sync "$s3_name" "$backup_s3_name"
gonogo "s3_sync"
elif [ "$run_option" == "daily_backup" ]; then
GetUtil
InstallAWS
Expand Down

0 comments on commit d87d9df

Please sign in to comment.