Is there any command to delete the backups older than x days.
Hello, yes there is. Take a look at Delete backups - Percona Backup for MongoDB
If i want to delete the backups which is older than 5 days. Below command didn’t work. Please advise.
pbm delete-backup -f --older-than $(date -d ‘-5 days’ +%Y-%m-%d);
The problem is likely in the output of the date expression. Try printing the date first, also what is the error?
Hi Ivan_Groenewold,
It doesn’t throw any error. Its executing but not deleting anything.
[mongod@ip-xxxx pbm]$ pbm delete-backup -f --older-than $(date -d ‘-5 days’ +%Y-%m-%d);
Waiting for delete to be done …[done]
Backup snapshots:
2022-10-22T01:02:04Z [complete: 2022-10-22T23:00:52Z]
2022-11-05T01:02:04Z [complete: 2022-11-05T17:24:38Z]
2022-11-12T01:02:04Z [complete: 2022-11-12T23:25:56Z]
PITR :
2022-10-22T23:00:53Z - 2022-10-23T18:00:13Z
2022-11-05T17:24:39Z - 2022-11-06T18:00:11Z
2022-11-12T23:25:57Z - 2022-11-13T18:00:08Z