On Fri, 20 Dec 2024 at 09:17, Meth <
bys...@gmail.com> wrote:
Hi Meth,
Thanks for sharing with us your PostgreSQL backup job settings. I am
not a PostgreSQL expert, but I will try to answer.
> My questions are:
> 1. Is this configuration sufficient for a complete PostgreSQL backup including the Bacula catalog?
I think that it is OK however I don't know all pg_dumpall parameters
and I can't say for 100%.
> 2. Are there any potential issues or missing steps in this setup?
If your intention is to preserve log for all backups then you can change this:
2>/var/log/bacula-pg_dump.log
into this:
2>>/var/log/bacula-pg_dump.log
I would also propose to remove in Runscript #3 :
Runs On Failure: yes
FailJobOnError: No
because otherwise you will not know if the dump will fail.
> 3. Should I add any additional error handling or verification steps?
Bacula checks the error codes of the Runscript commands, so it can be
sufficient.
> 4. Is the cleanup process (RunScript #4) appropriate, or should I handle it differently?
Yes, it looks fine. If you want, you can create a bacula-pg_dump
directory only once, remove content of the bacula-pg_dump directory
after each backup and keep it empty:
rm -f /var/backups/bacula-pg_dump/*.sql
This way it does not need to be created for every backup and
Runscripts #1 and #2 in this case are not needed.
> Any suggestions for improving this backup configuration would be greatly appreciated.
Maybe an improvement could be to remove logging to
/var/log/bacula-pg_dump.log and let errors be displayed on stderr.
This way errors will be added to Bacula job log and if a job fails
then you can go to the job log to see errors.
If you want you can use some keywords from Bacula in the dump file
name (like: %s - job name %c - client name ...etc.). You can find them
here:
https://www.bacula.org/15.0.x-manuals/en/main/Configuring_Director.html#Director:Job:Runscript
At the end, generally in case runscripts I prefer to use scripts to
put all commands there. If you will have more commands to backup
PostgreSQL you can consider putting them in a script and use in one or
two Runscripts.
I hope it will be helpful.
Good luck!
Best regards,
Marcin Haba (gani)