Unable to delete PBM backups (both PITR and full backups)

Hi Team,

We are currently using PBM version 2.0

Issue#1 (without PITR)
I am unable to delete PBM backups that are older than ‘X’ number of days.

Command I’m using for deleting the backups older than 5 days.
pbm delete-backup -f --older-than $(date -d ‘-5 days’ +%Y-%m-%d);

How can we setup backup retention policy in PBM?
Can we setup a cron to delete the backups in parallel with the backup schedule job?

For a replicaset on which PITR is enabled, we are unable to delete the PITR chunks manually.

Example command that doesn’t work
pbm delete-pitr --older-than=“2022-09-24T18:49:36Z” # will delete [2022-09-17T17:39:12Z - 2022-09-18T17:44:51Z]

Please help me on this.

I see an open JIRA for ability to delete older backups/pitr chunks. Any Idea when will this JIRA gets resolved?


Hey, @kirangelli

Sorry for the delay. We discussed your case and required changes to PBM logic. We will provide solution to simply/easy maintain retention policy in the next release.

You can track the progress here [PBM-850] Add ability to delete older backups - Percona JIRA

For now, PBM does not allow to delete old backups if they are the base snapshot for Point-in-Time restore. You have to delete oplog ranges that covers these snapshots first. Valid ranges for deletion are before/older than the latest/recent full backup.

1 Like

Hey @Dmytro_Zghoba

Thank you for your response.

Hey @Dmytro_Zghoba

We have upgraded our PBM to the latest version 2.1.0 with PITR enabled.
Storage location: AWS S3 bucket.

However, when I tried to delete the backups using the below command.
pbm cleanup --older-than=“2023-05-18T15:00:00”, it is throwing the below error.

2023-05-31T10:12:37Z E [XXXPROD/xxx:27017] [cleanup] delete chunk file “pbmPitr/xxxprod/20230513/20230513080806-2.20230513081806-2.oplog.s2”: delete ‘pbm-mongo-prod/pbmPitr/XXX/20230513/20230513080806-2.20230513081806-2.oplog.s2’ file from S3: AccessDenied: Access Denied
status code: 403 , request id: 7ADR2VEW0MVF3N6J

Do we need to make any changes to the configuration? or grant permissions to specifc user at the S3 bucket level?
Please advice.


hi @kirangelli,

I see S3-side error. Please double-check permissions.