Inedo Community Forums Forums
    • Recent
    • Tags
    • Popular
    • Login

    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

    Scheduled Pinned Locked Moved Support
    6 Posts 3 Posters 14 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • N Offline
      nathan.wilcox_0355
      last edited by

      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?

      atrippA 1 Reply Last reply Reply Quote 0
      • atrippA Offline
        atripp inedo-engineer @nathan.wilcox_0355
        last edited by

        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

        1 Reply Last reply Reply Quote 0
        • N Offline
          nathan.wilcox_0355
          last edited by nathan.wilcox_0355

          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.1

          so 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

          atrippA 1 Reply Last reply Reply Quote 0
          • atrippA Offline
            atripp inedo-engineer @nathan.wilcox_0355
            last edited by

            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

            1 Reply Last reply Reply Quote 0
            • N Offline
              nathan.wilcox_0355
              last edited by nathan.wilcox_0355

              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.

              stevedennisS 1 Reply Last reply Reply Quote 0
              • stevedennisS Offline
                stevedennis inedo-engineer @nathan.wilcox_0355
                last edited by

                @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

                1 Reply Last reply Reply Quote 0

                Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                With your input, this post could be even better 💗

                Register Login
                • 1 / 1
                • First post
                  Last post
                Inedo Website Home • Support Home • Code of Conduct • Forums Guide • Documentation