Automate cleanup of apt repo snapshots

We are in a scenario where we need regular snapshots with a timestamp in the name.
Over time this would create a lot of uniquely named snapshots so I am looking into ways to automate the cleanup for that.

That’s where I run into problems… there seem to be no built in tasks or cleanup policies to clean up apt repo snapshots (yum repos for example have a snapshot version release type criteria for cleanup policies). Since the cleanup policies for apt only affect components/assets, which does not include snapshots. I played around with the rest API search but there seems to be no way to list the existing snapshots for an apt repo, so we cant filter and delete them ourselves using the api either.

Am I missing something? Is there a way to achieve this, how do other people deal with apt snapshot cleanup

1 Like

It looks like there’s an open ticket that might be relevant, in case you haven’t seen it

Maybe upvote that. I could definitely use this feature myself

Let me ask you one thing though, are you using snapshots in proxy repos or hosted repos? I haven’t been able to make snapshots in APT work properly and i thought the feature was just not working properly for proxy repos (i haven’t tried with hosted) so knowing if it works for someone else will give me hope to continue trying

We use it for hosted repos at the moment. Tanks for the issue link, that does look like what we need