Backup and Restore Progress

30 views
Skip to first unread message

Alan Eduardo F. Dias

unread,
Mar 24, 2023, 7:18:34 AM3/24/23
to Barman, Backup and Recovery Manager for PostgreSQL
Is it possible to see the progress of a Backup or Restore?

Andre Karvelas

unread,
Sep 27, 2023, 2:20:41 AM9/27/23
to Barman, Backup and Recovery Manager for PostgreSQL
Hi Alan,

There is no GUI for Barman and neither does the backup process show any progress.

I ended up creating a web based dashboard and a bash script to provide me with a means of seeing the progress.

You will need to check the current file size of the live DB and then do a continues compare with the file size in barman as it is backing up.

while awk 'BEGIN { if ('$PER' >= 100) {exit 1} }'; do

         BFS=`du -scb $BKDIR | cut -f1 | head -1`
         PER=`printf %.1f "$((10**3 * $BFS/$DBFS * 100))e-3"`
         echo $PER

done

BKDIR - backup dir on barman (/var/lib/barman/dir_name/base)
BFS - get backup dir size
DBFS - dir size of live DB (/var/lib/postgresql/ver/main/base)
PER - percentage calculation

The full script is more involved for my purposes, but I hope this helps to get your own project started.

Regards
Andre
Reply all
Reply to author
Forward
0 new messages