Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.
If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!
Delete asset by age
-
Hi, we have an asset directory and would like to be able to delete all assets created before a certain date. Is there a way to do this with file retention policy or via the api?
-
Hi @nathan-wilcox_0355 ,
Asset directory policies don't consider the creation date; instead, we would recommend setting a policy like "keep files downloaded in last 90 days".
That will delete everything that hasn't been downloaded in the last 90 days.
Cheers,
Alana
-
We store software installer versions in an asset directory and have the version as part of the name, i.e.
softwareinstaller_v1.1.1
softwareinstaller_v1.2.1
softwareinstaller_v1.3.1so we don't want to delete based on number of downloads because there could be a case where nobody has downloaded the installer in so long, but we still wouldn't want to delete it. We'd always want the latest few available regardless of number of downloads
-
Hi @nathan-wilcox_0355 ,
Thanks for clarifying; so basically I think you you'll need to parse those version numbers instead of trying to rely on on publish dates. I think this will require some kind of custom script to capture the deletion logic you need....
You may want to consider using Universal Packages, which does let you keep the last X versions of a particular package. You could then use pre-release versioning as well, which typically is what something like a CI server would create.
Hope that helps,
Alana
-
Thanks,
We're just going to do some powershell scripting to get all the assets, parse out the ones that we want to delete and then delete them with the API.
-
@nathan-wilcox_0355 great to know!
And if you happen to have a shareable script, by all means post the results here - we'd love to share it on the docs, to help other users see some real-world use case