# Properly purging old data

**URL:** <https://discuss.elastic.co/t/properly-purging-old-data/24466>\
**Category:** Elasticsearch\
**Created:** [June 26, 2015, 10:04pm UTC](https://discuss.elastic.co/t/properly-purging-old-data/24466 "2015-06-26T22:04:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![DigiAngel](https://avatars.discourse-cdn.com/v4/letter/d/977dab/32.png) [@DigiAngel](https://discuss.elastic.co/u/DigiAngel)\
**Post date:** [June 26, 2015, 10:04pm UTC](https://discuss.elastic.co/t/properly-purging-old-data/24466/1 "2015-06-26T22:04:08Z")

</div>

Hey all. Topic says it here...wanting to know how to PROPERLY purge data. I have a script I got:

elasticsearch-remove-old-indices.sh

Which was inspired by: [backup/restore/purge](http://tech.superhappykittymeow.com/?p=296). Usually this works, but I wanted to see if anyone had a better method. Thank you.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [June 26, 2015, 10:51pm UTC](https://discuss.elastic.co/t/properly-purging-old-data/24466/2 "2015-06-26T22:51:18Z")

</div>

Are you using time based data, if so the best option is to use time based indices and then just delete the index using [Elasticsearch Curator](https://www.elastic.co/guide/en/elasticsearch/client/curator/current/index.html).

---

<div class="post-metadata">

**Author:** ![DigiAngel](https://avatars.discourse-cdn.com/v4/letter/d/977dab/32.png) [@DigiAngel](https://discuss.elastic.co/u/DigiAngel)\
**Post date:** [June 27, 2015, 12:30pm UTC](https://discuss.elastic.co/t/properly-purging-old-data/24466/3 "2015-06-27T12:30:49Z")

</div>

I was unaware of curator....installed and it worked perfectly...thanks so much.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 12:04am UTC](https://discuss.elastic.co/t/properly-purging-old-data/24466/4 "2017-07-06T00:04:58Z")

</div>


