postgresql_backup. Optimizing output.

This commit is contained in:
Alexey Skobkin 2024-11-06 19:46:33 +00:00
parent 198285910a
commit a2f25f51a8

View file

@ -49,8 +49,6 @@ for PREFIX in $DATABASE_PREFIXES; do
# Loop over each database and create a backup
for DB_NAME in $DATABASES; do
echo "Starting backup for database '$DB_NAME' on $HOST:$PORT..."
# Set file extension based on DUMP_FORMAT
EXTENSION="dump"
if [[ "$DUMP_FORMAT" == "sql" ]]; then
@ -59,7 +57,8 @@ for PREFIX in $DATABASE_PREFIXES; do
# Set backup file path within the server-specific directory
BACKUP_FILE="$SERVER_DIR/$DB_NAME.$EXTENSION"
echo "Backup file: $BACKUP_FILE"
echo "Dumping '$DB_NAME' on $HOST:$PORT to $BACKUP_FILE"
# Perform the backup based on the specified format
if [[ "$DUMP_FORMAT" == "custom" ]]; then
@ -71,7 +70,7 @@ for PREFIX in $DATABASE_PREFIXES; do
continue
fi
echo "Backup for database '$DB_NAME' on $HOST:$PORT completed successfully."
du -sh $BACKUP_FILE
done
done