postgresql backup wal_archive

29 views
Skip to first unread message

Philippe

unread,
Mar 27, 2025, 5:53:36 AMMar 27
to bareos-users
Hi all,


I'm using the postgresql-plugin for a while now with these
postgresql-settings:

> archive_mode = on
> archive_command = 'install -D %p /path/to/wal_archive/%f'
> restore_command = 'cp /path/to/wal_archive/%f %p'

Now the wal_archive can take up a lot of disk space and I'd like to
compress it:

> archive_command = 'zstd -q -T0 %p -o /path/to/wal_archive/%f.zst'
> restore_command = 'zstd -q -T0 -d /path/to/wal_archive/%f.zst -o %p'

Can Bareos and the postgresql-plugin handle this? Or is there anything
else that I should consider?


Best,

Philippe

Philippe

unread,
Mar 27, 2025, 8:16:34 AMMar 27
to bareos...@googlegroups.com
Well, apparently this fails because bareos is looking for [0-9a-f]{24}
and ignores the resulting .zst files.
Okay, I can circumvent that by modifying the commands

> archive_command = 'zstd -q -T0 %p -o /path/to/wal_archive/%f'
> restore_command = 'zstd -q -T0 -d /path/to/wal_archive/%f -o %p'

Backup works, but didn't test restore yet. Are there any pitfalls to expect?

Best,

Philippe

Bruno Friedmann (bruno-at-bareos)

unread,
Mar 27, 2025, 12:06:56 PMMar 27
to bareos-users
Hello, for the backup as we are also asking PG the last wal name and  so on, changing those name can be a pitfall.
For the restore it shouldn't be a problem, as we restore the list of file present in the backup. and then PG is doing its stuff when recovering.

Philippe

unread,
Mar 27, 2025, 1:06:46 PMMar 27
to bareos...@googlegroups.com
Hi Bruno,

thanks! Then I'll keep it that way (ie. compressed but un-renamed) :)

- Philippe

Reply all
Reply to author
Forward
0 new messages