# Trying to understand retention policies

**URL:** <https://kopia.discourse.group/t/trying-to-understand-retention-policies/164>\
**Category:** Support\
**Created:** [October 4, 2020, 10:38pm UTC](https://kopia.discourse.group/t/trying-to-understand-retention-policies/164 "2020-10-04T22:38:41Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![jkowalski](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/jkowalski/32/3_2.png) [@jkowalski](https://kopia.discourse.group/u/jkowalski)\
**Post date:** [October 5, 2020, 5:38am UTC](https://kopia.discourse.group/t/trying-to-understand-retention-policies/164/4 "2020-10-05T05:38:10Z")

</div>

After each snapshot is taken, kopia will assign retention tag to snapshots and delete snapshots that don’t have any assigned tag.

Tags are assigned as follows:

- `latest-N` will be assigned to all snapshots going backwards where the most recent snapshot gets latest-1, previous is latest-2 and so on.

- `hourly-N` will be assigned to the latest snapshot within each respective hour, going back no more than M hours where M is defined by `--keep-hourly` parameter.

For example if you have done snapshots at:

```auto
2001-01-01 14:01 - not hourly because 14:30 was the last snapshot of this hour
2001-01-01 14:30 - hourly-2
2001-01-01 15:01 - not hourly because 15:55 was the last snapshot of this hour
2001-01-01 15:02 - not hourly because 15:55 was the last snapshot of this hour
2001-01-01 15:40 - not hourly because 15:55 was the last snapshot of this hour
2001-01-01 15:50 - not hourly because 15:55 was the last snapshot of this hour
2001-01-01 15:55 - hourly-1

```

Similarly `daily-N` is assigned to the latest snapshot within each day:

```auto
2001-01-01 14:01 - not daily because 15:55 was done the same day
2001-01-01 15:55 - daily-5
2001-01-02 14:01 - daily-4
2001-01-03 15:55 - daily -3
2001-01-04 14:01 - not daily because 15:01 was done the same day
2001-01-04 15:01 - daily-2
2001-01-05 15:55 - daily-1

```

Same rule applies to weekly, monthly, quarterly and annual retention rules - each of them retains latest snapshot within a given time period up to a defined limit.

Note the limit applies to both count and time, so if you have keep-hourly 48, it will keep no more than 48 hourly snapshots going back no more than 48 hours since the last snapshot.

---

_[View the full topic](https://kopia.discourse.group/t/trying-to-understand-retention-policies/164)._
