Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
nihaldivyam committed Mar 28, 2024
1 parent 00203b4 commit dbbff6b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions logical-backup/dump.sh
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ function aws_upload_dir {
echo "Uploading dump dir to s3"
aws s3 cp "$1" "$PATH_TO_BACKUP"/$dbname.gz
}

function gcs_upload {
PATH_TO_BACKUP=gs://${LOGICAL_BACKUP_S3_BUCKET}"/"${POSTGRES_OPERATOR}"/"${LOGICAL_BACKUP_S3_BUCKET_SCOPE_SUFFIX}"/logical_backups/"$(date +%Y-%m-%d).sql.gz

Expand Down Expand Up @@ -169,12 +170,10 @@ if [[ "$LOGICAL_BACKUP_PROVIDER" == "s3" && -z "$PGDATABASE" ]]; then
dump_db $dbname
echo "Uploading directory /tmp/db-$dbname to $PATH_TO_BACKUP/$dbname..."
pigz "/tmp/db-$dbname"
ls -lah "/tmp/"
aws_upload_dir "/tmp/db-$dbname.gz" "$PATH_TO_BACKUP/$dbname"
echo "Cleaning up /tmp/db-$dbname..."
rm -rf "/tmp/db-$dbname.gz"
done < /tmp/database-list
sleep 10000
rm /tmp/database-list

exit $ERRORCOUNT
Expand All @@ -186,6 +185,7 @@ elif [[ "$LOGICAL_BACKUP_PROVIDER" == "az" && -z "$PGDATABASE" ]]; then
echo "Dumping $dbname..."
dump_db $dbname
echo "Uploading directory /tmp/db-$dbname to $PATH_TO_BACKUP/$dbname..."
pigz "/tmp/db-$dbname"
az_upload_dir "/tmp/db-$dbname" "$PATH_TO_BACKUP/$dbname"
echo "Cleaning up /tmp/db-$dbname..."
rm -rf "/tmp/db-$dbname"
Expand Down

0 comments on commit dbbff6b

Please sign in to comment.