# What is better to recover disk space

**URL:** <https://discuss.elastic.co/t/what-is-better-to-recover-disk-space/119112>\
**Category:** Elasticsearch\
**Created:** [February 8, 2018, 7:58pm UTC](https://discuss.elastic.co/t/what-is-better-to-recover-disk-space/119112 "2018-02-08T19:58:40Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rbeg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rbeg/32/56818_2.png) [@rbeg](https://discuss.elastic.co/u/rbeg)\
**Post date:** [February 8, 2018, 7:58pm UTC](https://discuss.elastic.co/t/what-is-better-to-recover-disk-space/119112/1 "2018-02-08T19:58:40Z")

</div>

Hello, I have 1 index per day.  
I want to delete all my data that is older than 1 week, not to saturate my disk space.  
What should I do for that :

1. delete index ([Delete Index](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-delete-index.html))
2. delete all documents of my index ([Delete By Query API](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete-by-query.html))
3. Delete all documents of my index and then delete index
4. Delete documents, shrink, delete index

Thank you for advance.

---

<div class="post-metadata">

**Author:** ![djtecha](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/djtecha/32/54011_2.png) [@djtecha](https://discuss.elastic.co/u/djtecha)\
**Post date:** [February 8, 2018, 8:23pm UTC](https://discuss.elastic.co/t/what-is-better-to-recover-disk-space/119112/2 "2018-02-08T20:23:07Z")

</div>

Just delete the old indices, it's a super quick operation and the OS should be able to reclaim the space.

---

<div class="post-metadata">

**Author:** ![rbeg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rbeg/32/56818_2.png) [@rbeg](https://discuss.elastic.co/u/rbeg)\
**Post date:** [February 8, 2018, 8:24pm UTC](https://discuss.elastic.co/t/what-is-better-to-recover-disk-space/119112/3 "2018-02-08T20:24:26Z")

</div>

Thank you.  
Simple, good work Elastic.  
I just tried, it work fine. No shrink necessity.

---

<div class="post-metadata">

**Author:** ![Diggy](https://avatars.discourse-cdn.com/v4/letter/d/e99b99/32.png) [@Diggy](https://discuss.elastic.co/u/Diggy)\
**Post date:** [February 8, 2018, 8:32pm UTC](https://discuss.elastic.co/t/what-is-better-to-recover-disk-space/119112/4 "2018-02-08T20:32:09Z")

</div>

You could also use Curator. Set it up to delete indices, then run as a cron job. I do that, and it works a treat.

---

<div class="post-metadata">

**Author:** ![rbeg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rbeg/32/56818_2.png) [@rbeg](https://discuss.elastic.co/u/rbeg)\
**Post date:** [February 8, 2018, 8:39pm UTC](https://discuss.elastic.co/t/what-is-better-to-recover-disk-space/119112/5 "2018-02-08T20:39:50Z")

</div>

Thank you, I will see that, if it's better than launching my shell script with crontab.

---

<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:** [March 8, 2018, 8:40pm UTC](https://discuss.elastic.co/t/what-is-better-to-recover-disk-space/119112/6 "2018-03-08T20:40:01Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
