# Cron job for purging disk space

**URL:** <https://discuss.elastic.co/t/cron-job-for-purging-disk-space/73125>\
**Category:** Elasticsearch\
**Created:** [January 29, 2017, 12:54pm UTC](https://discuss.elastic.co/t/cron-job-for-purging-disk-space/73125 "2017-01-29T12:54:12Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shadowraze](https://avatars.discourse-cdn.com/v4/letter/s/ecccb3/32.png) [@Shadowraze](https://discuss.elastic.co/u/Shadowraze)\
**Post date:** [January 29, 2017, 12:54pm UTC](https://discuss.elastic.co/t/cron-job-for-purging-disk-space/73125/1 "2017-01-29T12:54:12Z")

</div>

So I decided to use elastic curator for this, that's my action.yml [http://pastebin.com/kRL3q9cq](http://pastebin.com/kRL3q9cq).  
I'm not sure that I clearly understand what merging will do. I think my curator action file should delete old indices and merge them. Is merging deleting old files from disk?

---

<div class="post-metadata">

**Author:** ![JKhondhu](https://avatars.discourse-cdn.com/v4/letter/j/ed655f/32.png) [@JKhondhu](https://discuss.elastic.co/u/JKhondhu)\
**Post date:** [January 29, 2017, 2:31pm UTC](https://discuss.elastic.co/t/cron-job-for-purging-disk-space/73125/2 "2017-01-29T14:31:31Z")

</div>

A forceMerge(Optimize, or rather forceMerge) operation will try to reduce the segment count in each shard in your indices. Since each segment has an overhead, more segments means more resources used.

---

<div class="post-metadata">

**Author:** ![Shadowraze](https://avatars.discourse-cdn.com/v4/letter/s/ecccb3/32.png) [@Shadowraze](https://discuss.elastic.co/u/Shadowraze)\
**Post date:** [January 29, 2017, 2:37pm UTC](https://discuss.elastic.co/t/cron-job-for-purging-disk-space/73125/3 "2017-01-29T14:37:22Z")

</div>

Thank you. So any good practices for cleaning up disk space from old deleted indexes(by curator)?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [January 29, 2017, 3:17pm UTC](https://discuss.elastic.co/t/cron-job-for-purging-disk-space/73125/4 "2017-01-29T15:17:16Z")

</div>

When indices are deleted, disk space should be released. Is this not the case? Have you verified that the indices are deleted as expected? Which version of Elasticsearch and Curator are you using?

---

<div class="post-metadata">

**Author:** ![Shadowraze](https://avatars.discourse-cdn.com/v4/letter/s/ecccb3/32.png) [@Shadowraze](https://discuss.elastic.co/u/Shadowraze)\
**Post date:** [January 29, 2017, 9:02pm UTC](https://discuss.elastic.co/t/cron-job-for-purging-disk-space/73125/5 "2017-01-29T21:02:09Z")

</div>

After I run curator with action conf that I posted in first message indices were deleted, I didn't see indices which older than 7 days in Kibana monitoring app, I guess it's enough for verifying. But disk space didn't release.

Elasticsearch 5.1.1  
Curator 4.2.5

---

<div class="post-metadata">

**Author:** ![Shadowraze](https://avatars.discourse-cdn.com/v4/letter/s/ecccb3/32.png) [@Shadowraze](https://discuss.elastic.co/u/Shadowraze)\
**Post date:** [January 30, 2017, 3:11pm UTC](https://discuss.elastic.co/t/cron-job-for-purging-disk-space/73125/6 "2017-01-30T15:11:37Z")

</div>

So maybe I missing something, why my disk space does not free up after deleting indices?

---

<div class="post-metadata">

**Author:** ![Shadowraze](https://avatars.discourse-cdn.com/v4/letter/s/ecccb3/32.png) [@Shadowraze](https://discuss.elastic.co/u/Shadowraze)\
**Post date:** [February 8, 2017, 6:25pm UTC](https://discuss.elastic.co/t/cron-job-for-purging-disk-space/73125/7 "2017-02-08T18:25:25Z")

</div>

Bump, still looking for the solution.

---

<div class="post-metadata">

**Author:** ![JKhondhu](https://avatars.discourse-cdn.com/v4/letter/j/ed655f/32.png) [@JKhondhu](https://discuss.elastic.co/u/JKhondhu)\
**Post date:** [February 9, 2017, 5:08pm UTC](https://discuss.elastic.co/t/cron-job-for-purging-disk-space/73125/8 "2017-02-09T17:08:20Z")

</div>

> [@Shadowraze](#):
>
> didn't see indices which older than 7 days in Kibana monitoring app

Can you confirm that your curator installation is deleting your indices older than _n_?

---

<div class="post-metadata">

**Author:** ![Shadowraze](https://avatars.discourse-cdn.com/v4/letter/s/ecccb3/32.png) [@Shadowraze](https://discuss.elastic.co/u/Shadowraze)\
**Post date:** [February 9, 2017, 6:15pm UTC](https://discuss.elastic.co/t/cron-job-for-purging-disk-space/73125/9 "2017-02-09T18:15:06Z")

</div>

Yes, they gone from elasticsearch and monitoring app in kibana which show elastic indices.

---

<div class="post-metadata">

**Author:** ![Shadowraze](https://avatars.discourse-cdn.com/v4/letter/s/ecccb3/32.png) [@Shadowraze](https://discuss.elastic.co/u/Shadowraze)\
**Post date:** [March 2, 2017, 4:57pm UTC](https://discuss.elastic.co/t/cron-job-for-purging-disk-space/73125/10 "2017-03-02T16:57:38Z")

</div>

bump

---

<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 30, 2017, 4:57pm UTC](https://discuss.elastic.co/t/cron-job-for-purging-disk-space/73125/11 "2017-03-30T16:57:48Z")

</div>

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