# How to set up Cleanup Policies?

**URL:** <https://community.sonatype.com/t/how-to-set-up-cleanup-policies/15467>\
**Category:** Sonatype Nexus Repository\
**Tags:** help, docker, nexus-repository, cleanup\
**Created:** [August 25, 2025, 1:03pm UTC](https://community.sonatype.com/t/how-to-set-up-cleanup-policies/15467 "2025-08-25T13:03:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![1445499792](https://avatars.discourse-cdn.com/v4/letter/1/a9a28c/32.png) [@1445499792](https://community.sonatype.com/u/1445499792)\
**Post date:** [August 25, 2025, 1:03pm UTC](https://community.sonatype.com/t/how-to-set-up-cleanup-policies/15467/1 "2025-08-25T13:03:05Z")

</div>

- Version: Sonatype Nexus Repository OSS 3.67.1-01
- Deployment Method: Docker  
﻿  
I need to set up a cleanup policy for Maven Snapshots: I want to clean up those older than 10 days but must retain the latest one.  
﻿  
I set Component Ageto 10, and it did clean up those older than 10 days, but it also deleted the only remaining one, which is not what I want. I need to ensure that the latest one is always retained, no matter what.

---

<div class="post-metadata">

**Author:** ![mpiggott](https://avatars.discourse-cdn.com/v4/letter/m/f0a364/32.png) [@mpiggott](https://community.sonatype.com/u/mpiggott)\
**Post date:** [August 25, 2025, 1:39pm UTC](https://community.sonatype.com/t/how-to-set-up-cleanup-policies/15467/2 "2025-08-25T13:39:16Z")

</div>

You might want to use the Maven Snapshot Remover as opposed to cleanup - [Maven SNAPSHOT Tasks](https://help.sonatype.com/en/maven-snapshot-tasks.html)

---

<div class="post-metadata">

**Author:** ![1445499792](https://avatars.discourse-cdn.com/v4/letter/1/a9a28c/32.png) [@1445499792](https://community.sonatype.com/u/1445499792)\
**Post date:** [August 28, 2025, 1:33pm UTC](https://community.sonatype.com/t/how-to-set-up-cleanup-policies/15467/3 "2025-08-28T13:33:40Z")

</div>

This is what I want, thank you
