From a2f25f51a8a4a6092f1850132f091d741539e20b Mon Sep 17 00:00:00 2001 From: skobkin Date: Wed, 6 Nov 2024 19:46:33 +0000 Subject: [PATCH] postgresql_backup. Optimizing output. --- postgresql_backup/pg_backup.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/postgresql_backup/pg_backup.sh b/postgresql_backup/pg_backup.sh index 5e6f668..05e8a48 100644 --- a/postgresql_backup/pg_backup.sh +++ b/postgresql_backup/pg_backup.sh @@ -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