diff --git a/logical-backup/dump.sh b/logical-backup/dump.sh index 41735bc..6c41b6e 100755 --- a/logical-backup/dump.sh +++ b/logical-backup/dump.sh @@ -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 @@ -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 @@ -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"