Skip to content

Commit cccac1c

Browse files
committed
fix: Add more verbose logs for postgres backup and restore
1 parent dc4b77f commit cccac1c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

charts/dependencies/files/postgres/backup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ fi
3838
backup(){
3939
for DB in $DATABASES; do
4040
echo "[$(date +%F\ %H:%M:%S)] Backing up PostgreSQL '$DB' database"
41-
pg_dump -h $POSTGRES_HOST -U $POSTGRES_USER -d $DB -F c -f $BACKUP_DIR/${DB}.dump
41+
pg_dump -v -h $POSTGRES_HOST -U $POSTGRES_USER -d $DB -F c -f $BACKUP_DIR/${DB}.dump
4242
echo "[$(date +%F\ %H:%M:%S)] Backups completed: $BACKUP_DIR/${DB}.dump"
4343
done
4444
# Dump roles without passwords

charts/dependencies/files/postgres/restore.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ restore_databases(){
6262
DB_ARCHIVE_PATH="$WORK_PATH/$DB.dump"
6363
if [ -f "$DB_ARCHIVE_PATH" ]; then
6464
echo "[$(date +%F\ %H:%M:%S)] Restoring database: $DB"
65-
pg_restore -h $POSTGRES_HOST -U $POSTGRES_USER -d $DB -F c $DB_ARCHIVE_PATH
65+
pg_restore -v -h $POSTGRES_HOST -U $POSTGRES_USER -d $DB -F c $DB_ARCHIVE_PATH
6666
else
6767
echo "[$(date +%F\ %H:%M:%S)] [WARN] Archive for $DB not found: $DB_ARCHIVE_PATH" >&2
6868
fi

0 commit comments

Comments
 (0)