# Elasticsearch Snapshot

**URL:** <https://discuss.elastic.co/t/elasticsearch-snapshot/254907>\
**Category:** Elasticsearch\
**Created:** [November 10, 2020, 12:40pm UTC](https://discuss.elastic.co/t/elasticsearch-snapshot/254907 "2020-11-10T12:40:16Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![RAM\_NATHAN](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ram_nathan/32/50393_2.png) [@RAM\_NATHAN](https://discuss.elastic.co/u/RAM_NATHAN)\
**Post date:** [November 11, 2020, 10:23am UTC](https://discuss.elastic.co/t/elasticsearch-snapshot/254907/11 "2020-11-11T10:23:43Z")

</div>

Thanks.. Its working fine. So with below SLM policy

```auto
PUT /_slm/policy/nightly-snapshots
{
  "schedule": "0 30 1 * * ?", 
  "name": "<nightly-snap-{now/d}>", 
  "repository": "my_repository", 
  "config": { 
    "indices": ["*"] 
  },
  "retention": { 
    "expire_after": "30d", 
    "min_count": 5, 
    "max_count": 50 
  }
} 

```

1)should I worry about deleting old snapshots peroidically? or retention policy will take care of that?  
2) I tried to set expire\_after to 1m and max\_count to 5, when I create more than 5 snapshots, old ones are not getting deleted. Im able see that. I saw similar issue reported  
[Snapshot Retention Task not deleting expired snapshots](https://discuss.elastic.co/t/snapshot-retention-task-not-deleting-expired-snapshots/215952). Im using 7.4.2. is it a bug?

---

_[View the full topic](https://discuss.elastic.co/t/elasticsearch-snapshot/254907)._
