# How to schedule auto archival of old indices?

**URL:** <https://discuss.elastic.co/t/how-to-schedule-auto-archival-of-old-indices/65582>\
**Category:** Elasticsearch\
**Created:** [November 10, 2016, 5:37am UTC](https://discuss.elastic.co/t/how-to-schedule-auto-archival-of-old-indices/65582 "2016-11-10T05:37:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![elasticheart](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elasticheart/32/65189_2.png) [@elasticheart](https://discuss.elastic.co/u/elasticheart)\
**Post date:** [November 10, 2016, 5:37am UTC](https://discuss.elastic.co/t/how-to-schedule-auto-archival-of-old-indices/65582/1 "2016-11-10T05:37:23Z")

</div>

Hi,

I use elastic stack 5.0 GA, and I know (and I use) how to delete old indices using `curl` like;

```
curl --user elastic:elasticpassword -XDELETE '192.168.1.1:9200/myindex-*?pretty'

```

I have named my indices in the pattern `name-yyyy-mm-dd` like `myindex-2016-11-10`. Deleting old indices manually works fine. But I want to automate this.

I have indices like `myindex-2016-11-01`, `myindex-2016-11-02` etc. I want to do an automated process, which backups old indices (say, older than 5 days), as a file, so that I can move that to my external HDD in case if its needed in future, and thereby freeing up my PC's HDD. Is this possible, or any workaround?

Thank you.

---

<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:** [November 10, 2016, 6:50am UTC](https://discuss.elastic.co/t/how-to-schedule-auto-archival-of-old-indices/65582/2 "2016-11-10T06:50:47Z")

</div>

Did you try curator ?

---

<div class="post-metadata">

**Author:** ![elasticheart](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elasticheart/32/65189_2.png) [@elasticheart](https://discuss.elastic.co/u/elasticheart)\
**Post date:** [November 10, 2016, 11:18am UTC](https://discuss.elastic.co/t/how-to-schedule-auto-archival-of-old-indices/65582/3 "2016-11-10T11:18:20Z")

</div>

@dadoonet I tried curator, to delete old indices using custom index name pattern. But I have doubts;

- Can I make curator work as per schedule? I mean, every day in a specific time, curator run automatically?
- Can I backup my archived indices to another location (like external HDD) and restore them later?
- Will it work with ES 5.0 GA?

Thanks.

---

<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:** [November 14, 2016, 12:34am UTC](https://discuss.elastic.co/t/how-to-schedule-auto-archival-of-old-indices/65582/4 "2016-11-14T00:34:32Z")

</div>

> [@elasticcloud](#):
>
> Can I make curator work as per schedule? I mean, every day in a specific time, curator run automatically?

If you use cron, sure.

> [@elasticcloud](#):
>
> Can I backup my archived indices to another location (like external HDD) and restore them later?

Curator can do snapshots, not restores.

> [@elasticcloud](#):
>
> Will it work with ES 5.0 GA?

Yes.

---

<div class="post-metadata">

**Author:** ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)\
**Post date:** [November 15, 2016, 9:40pm UTC](https://discuss.elastic.co/t/how-to-schedule-auto-archival-of-old-indices/65582/5 "2016-11-15T21:40:57Z")

</div>

> [@warkolm](#):
>
> Curator can do snapshots, not restores.

Curator 4 does, in fact, do restores: [Restore | Curator Reference [8.0] | Elastic](https://www.elastic.co/guide/en/elasticsearch/client/curator/current/restore.html)

---

<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:** [December 13, 2016, 9:41pm UTC](https://discuss.elastic.co/t/how-to-schedule-auto-archival-of-old-indices/65582/6 "2016-12-13T21:41:06Z")

</div>

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