# Setup to create daily snapshots and purge old snapshots

**URL:** <https://discuss.elastic.co/t/setup-to-create-daily-snapshots-and-purge-old-snapshots/78445>\
**Category:** Elasticsearch\
**Created:** [March 14, 2017, 5:44am UTC](https://discuss.elastic.co/t/setup-to-create-daily-snapshots-and-purge-old-snapshots/78445 "2017-03-14T05:44:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ywtsang](https://avatars.discourse-cdn.com/v4/letter/y/a698b9/32.png) [@ywtsang](https://discuss.elastic.co/u/ywtsang)\
**Post date:** [March 14, 2017, 5:44am UTC](https://discuss.elastic.co/t/setup-to-create-daily-snapshots-and-purge-old-snapshots/78445/1 "2017-03-14T05:44:25Z")

</div>

I am successfully to create snapshots at s3 and restore the snapshots to use.

Here is the cron I have setup:

es 5.2/curator4.2

0 0 \* \* \* curator\_cli --host snapshot --repository s3\_repo --wait\_for\_completion true

0 1 \* \* \* curator\_cli --host delete\_snapshots --repository s3\_repo --filter\_list '[{"filtertype":"age","source":"creation\_date","direction":"older","unit":"days","unit\_count":5}]'

It is checked that the snapshots are created daily and old snapshots are removed.

So I want to ask if the "remove old snapshot" cron run after the daily snapshot , will it be a problem if I restore from the latest snapshot? Will there be any data lost ? As I know the snapshots are created incrementally.

---

<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:** [March 14, 2017, 6:33pm UTC](https://discuss.elastic.co/t/setup-to-create-daily-snapshots-and-purge-old-snapshots/78445/2 "2017-03-14T18:33:37Z")

</div>

Snapshots are incremental as you note. If you delete one from 2 days ago, ES will keep any segments it needs to make sure it can still restore the one from today.

---

<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:** [April 11, 2017, 6:33pm UTC](https://discuss.elastic.co/t/setup-to-create-daily-snapshots-and-purge-old-snapshots/78445/3 "2017-04-11T18:33:51Z")

</div>

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