# New retention policy deletes old backups in a smart way

**URL:** <https://forum.duplicati.com/t/new-retention-policy-deletes-old-backups-in-a-smart-way/2195>\
**Category:** Announcements\
**Created:** [January 23, 2018, 6:47pm UTC](https://forum.duplicati.com/t/new-retention-policy-deletes-old-backups-in-a-smart-way/2195 "2018-01-23T18:47:03Z")\
**Posts on this page:** 1\
**Showing post:** 51

<div class="post-metadata">

**Author:** ![kees-z](https://forum.duplicati.com/user_avatar/forum.duplicati.com/kees-z/32/29_2.png) [@kees-z](https://forum.duplicati.com/u/kees-z)\
**Post date:** [February 12, 2018, 8:19pm UTC](https://forum.duplicati.com/t/new-retention-policy-deletes-old-backups-in-a-smart-way/2195/51 "2018-02-12T20:19:20Z")

</div>

My main thoughts/concerns are:

- Specifying a number should Always main: I want _at least_ this number of versions and not: I want _no more_ than this number of versions. So `1M:30,1Y:1M` should not mean “Delete all versions older than the first 30 versions”, but “Stop deleting when there are 30 remaining versions”. This will prevent deleting more versions than intended.
- I was thinking about some way to define the _total_ number of versions, not the versions in a specific time frame. Not thought of the exact syntax, but somehow a trailing number could be supplied, indicating the minimum number of versions to keep. You could add an optional `K:` to supply the minimum total number of versions.  
Alternatively, you could add an optional third value for each time frame, so `1M:1W` would mean "one backup for every week last month, and `1M:1W:3` would be interpreted as “one backup for every week last month, but stop deleting backups this months if there are 3 remaining backups in this time frame”.

My main concern is a common use case like `1M:1D`. If I choose this policy, my intention is that I have (around) 30 versions to choose from when doing a restore operation.  
If my computer is switched of for 1 month (holiday), all backup versions are deleted except 1, resulting in destroying all file versions with doing _nothing_. I see this as a potential problem.  
Combining with `--keep-versions` is not supported, so there is no way to keep my retention policy (if I backup twice a day, 50% can be deleted) **and** keep at least 20 versions. Something like `1M:1D;K:20` would resolve that.

---

_[View the full topic](https://forum.duplicati.com/t/new-retention-policy-deletes-old-backups-in-a-smart-way/2195)._
