Comprehensive data protection for all workloads
Post Reply
Tom Hagever
Novice
Posts: 8
Liked: never
Joined: Sep 26, 2023 4:42 pm
Full Name: Tom babai
Contact:

postgres why archive_command needs to be empty? whats in background

Post by Tom Hagever »

Hello all,
Im trying to use postgresql application aware for my postgres VMs, most of them are clusters but after reading this post:
veeam-backup-replication-f2/postgresql- ... 84718.html
I see that even though veeam does not support clusters, I can back up all the vms in the cluster and it would be fine.
however, my DBA team needs to understand why does the archive_command need to be empty in the postgres configuration.

when I run the backup and check the /tmp/PostgresAgent.log and checking with the command show archive_command; I cant see that anything is happening. does anybody know whats happening in the background?

another question: do I HAVE to have the archive_command empty and archive_mode on for postgres backup or is it just for WAL files backup?

Thanks in advance !
HannesK
Product Manager
Posts: 14322
Liked: 2890 times
Joined: Sep 01, 2014 11:46 am
Full Name: Hannes Kasparick
Location: Austria
Contact:

Re: postgres why archive_command needs to be empty? whats in background

Post by HannesK » 1 person likes this post

Hello,
the archive_command is needed for log shipping / point-in-time restore. If you did not configure that, then you won't see the archive_command.

Archive_mode on is only required for point-in-time restore / log backup.

"fine" is what you define :-) If you don't need point-in-time restore, then the answer is "no".

Best regards,
Hannes
Tom Hagever
Novice
Posts: 8
Liked: never
Joined: Sep 26, 2023 4:42 pm
Full Name: Tom babai
Contact:

Re: postgres why archive_command needs to be empty? whats in background

Post by Tom Hagever »

Thanks Hannes,
So even though veeam does not support clusters, if I make sure the archive_command has no value in all of the cluster vms, and then backing up all of them then I can restore each one of them to a point in time and that is basically a way around it?

Another question I got is does veeam make sure that the logs for the postgres wont grow forever? I saw that oracle and mssql have the option truncate logs or backing them up for restore for point in time. Is there something that prevents my logs to grow forever even when I use the logs backup?
HannesK
Product Manager
Posts: 14322
Liked: 2890 times
Joined: Sep 01, 2014 11:46 am
Full Name: Hannes Kasparick
Location: Austria
Contact:

Re: postgres why archive_command needs to be empty? whats in background

Post by HannesK »

Hello,
point-in-time recovery requires proper log file backup. WAL / log file backup requires Veeam to set the archive_command in the way we need it.

Just to be sure... this is point-in-time recovery: https://helpcenter.veeam.com/docs/backu ... ml?ver=120

Without log files, you can restore machines to the time when the image-level backup was taken, but not to the time in between. I'm not sure how much postgres likes that type of restore, but that's outside Veeam.
Another question I got is does veeam make sure that the logs for the postgres wont grow forever?
the archive_command ;-)
https://helpcenter.veeam.com/docs/backu ... ml?ver=120 - the greyed out settings on the last picture

Best regards,
Hannes
Tom Hagever
Novice
Posts: 8
Liked: never
Joined: Sep 26, 2023 4:42 pm
Full Name: Tom babai
Contact:

Re: postgres why archive_command needs to be empty? whats in background

Post by Tom Hagever »

ily hannes thanks for the answers
to be honest im still kinda confused about the deletion of the logs from inside the vm, I can see that unlike the grey settings in the link that you sent, the oracle settings have the options of: "Do not delete archived logs, Delete logs older than ** and Delete logs over ** GB". The postgres settings dont have such thing so Im confused.
Is it preventing the logs inside the vm to grow forever without asking me? ngl I dont mind if it does but still gotta know
HannesK
Product Manager
Posts: 14322
Liked: 2890 times
Joined: Sep 01, 2014 11:46 am
Full Name: Hannes Kasparick
Location: Austria
Contact:

Re: postgres why archive_command needs to be empty? whats in background

Post by HannesK »

yes, the Postgres settings are more like the SQL settings.

If you enabled "archive mode" / "full recovery model" / "archivelog" etc. for a database, then you need to take care of log files or they grow endless. You have the option with Veeam to handle log files as described in the user guide and it's up to you, whether you use that option or not. If we are responsible for logs, then we clean them up and prevent endless growth, yes (like any other backup software).
Post Reply

Who is online

Users browsing this forum: Google [Bot], Semrush [Bot] and 110 guests