# Snapshot retention with GCS repository

**URL:** <https://discuss.elastic.co/t/snapshot-retention-with-gcs-repository/233369>\
**Category:** Elasticsearch\
**Created:** [May 19, 2020, 3:58pm UTC](https://discuss.elastic.co/t/snapshot-retention-with-gcs-repository/233369 "2020-05-19T15:58:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sjoeboo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sjoeboo/32/68649_2.png) [@sjoeboo](https://discuss.elastic.co/u/sjoeboo)\
**Post date:** [May 19, 2020, 3:58pm UTC](https://discuss.elastic.co/t/snapshot-retention-with-gcs-repository/233369/1 "2020-05-19T15:58:25Z")

</div>

So I'm setting up snapshots and will be use GCS as my repository. I'd like to use the build in retention settings in GCS to automatically remove old snapshot data, instead of managing the rotation (removal) of old snapshots on my own (not using the SLM stuff as no x-pack).

Will GCS removing old snapshot objects out-from-under the repository cause issues? Would running the `_cleanup` prior to a new snapshot be enough to deal w/ old metadata?

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [May 20, 2020, 7:26am UTC](https://discuss.elastic.co/t/snapshot-retention-with-gcs-repository/233369/2 "2020-05-20T07:26:14Z")

</div>

> [@sjoeboo](#):
>
> Will GCS removing old snapshot objects out-from-under the repository cause issues?

Yes, it will render your repository completely unreadable. Where possible snapshots re-use objects from previous snapshots to save space and time. This means recent snapshots may still require access to older objects.

SLM is included the basic X-pack installation which costs nothing, I recommend you use that. Alternatively you will need to automate the deletion of older snapshots (via the snapshot API) yourself.

---

<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:** [June 17, 2020, 7:26am UTC](https://discuss.elastic.co/t/snapshot-retention-with-gcs-repository/233369/3 "2020-06-17T07:26:23Z")

</div>

Closed on June 17, 2020, 7:26am UTC

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