I am using the barman tool to backup the postgresql DB

barman is working fine but I notice that backup files that created under /var/lib/barman/main-db-server/base folder are not automatically being deleted after so many days.

I found the variable last_backup_maximum_age - but this only for reporting

 This option identifies a time frame that must contain the latest backup. If 
 the latest backup is older than the time frame, barman check command will 
 report an error to the user. If empty (default), latest backup is always 
 considered valid. Syntax for this option is: “i (DAYS | WEEKS | MONTHS)” 
 where i is a integer greater than zero, representing the number of days | 
 weeks | months of the time frame. Global/Server.

I can use

barman delete <server_name> oldest 

in order to delete every time the oldest file; however, I want to understand if I've missed something that can automatically delete the files once they reach a certain age; an auto-rotate or auto-delete functionality.

1 Answer 1


You should configure retention_policy.

Here's the syntax :

retention_policy = {REDUNDANCY value | RECOVERY WINDOW OF value {DAYS | WEEKS | MONTHS}}

You will find documentation here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.