# Indices get archived despite running Delete Scripts

**URL:** <https://discuss.elastic.co/t/indices-get-archived-despite-running-delete-scripts/37014>\
**Category:** Elasticsearch\
**Created:** [December 11, 2015, 7:35pm UTC](https://discuss.elastic.co/t/indices-get-archived-despite-running-delete-scripts/37014 "2015-12-11T19:35:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![parthu](https://avatars.discourse-cdn.com/v4/letter/p/e5b9ba/32.png) [@parthu](https://discuss.elastic.co/u/parthu)\
**Post date:** [December 11, 2015, 7:35pm UTC](https://discuss.elastic.co/t/indices-get-archived-despite-running-delete-scripts/37014/1 "2015-12-11T19:35:19Z")

</div>

Folks,

I wrote a cron job that runs a delete script that in turn deletes one index per day (to ensure that there are only 8 indices at any point of time). I do this coz we have space constraints on our Development server.

Of late, I observed that despite having just eight indices, the cluster health turns yellow and sometimes red due to space issues.

A little more research revealed that there's a path called /logdata/elasticsearch-dev/nodes/.  
When I cd to this location, I see this:  
0 1 2 3 4 5 6 7 8 9 10 11.

And another cd to each of these 'nodes', gives me this structure:  
indices node.lock

The directory 'indices' holds old indices (which I thought were no longer existent coz I deleted them manually). Similarly, other nodes also have the directory 'indices' storing stray indices that consume space.

Could any of you explain this concept of "nodes" holding "old indices" and my Delete script not having an effect on this?

Thanks

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [December 11, 2015, 7:59pm UTC](https://discuss.elastic.co/t/indices-get-archived-despite-running-delete-scripts/37014/2 "2015-12-11T19:59:58Z")

</div>

You probably ran more than one node on this machine (not recommended in prod).

Try to check how many nodes run locally.

If you stop all nodes and restart only one then you can remove all dirs but 0

---

<div class="post-metadata">

**Author:** ![parthu](https://avatars.discourse-cdn.com/v4/letter/p/e5b9ba/32.png) [@parthu](https://discuss.elastic.co/u/parthu)\
**Post date:** [December 11, 2015, 9:18pm UTC](https://discuss.elastic.co/t/indices-get-archived-despite-running-delete-scripts/37014/3 "2015-12-11T21:18:18Z")

</div>

> [@dadoonet](#):
>
> than

Is it safe to manually delete those archived indices?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [December 11, 2015, 9:32pm UTC](https://discuss.elastic.co/t/indices-get-archived-despite-running-delete-scripts/37014/4 "2015-12-11T21:32:47Z")

</div>

If your single running node is the node 0 and that you have in it all indices, then you are safe.

You could eventually start 12 instances on your machine and let all nodes synchronize. Then switch them one by one and wait for relocation.  
But if you are running out of disk that might not be a good idea.

---

<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 5, 2017, 11:31pm UTC](https://discuss.elastic.co/t/indices-get-archived-despite-running-delete-scripts/37014/5 "2017-07-05T23:31:40Z")

</div>


