Manually applying retention policies in 2.6

We missed the change in retention policies moving from 2.5 to 2.6 and we now have a problem with a few servers using too much disk space. Is there a way to force projects to apply retention policies without doing a deployment to each environment?

Hi Brian,

Thanks for getting in touch and sorry for the delay. Retention policies only run at the end of a deployment and cannot be triggered manually. The reason behind this is that we want Octopus to execute tasks only during deployments, and during that time we want octopus to be the most important thing running on the box. When a deployment is not running, we want Octopus to be as less important and silent as possible. Having Octopus run tasks such a retention policies out of a deployment context would make Octopus more like a system management tool instead of the awesome deployment tool it is meant to be :). " Do one thing, and do it right "

Hope this answers your question and helps you understand a bit more our philosophy



Hi Dalmiro,

This is a blocking issue for us, so asserting you are doing the right thing doesn’t really provide any help.

We are stuck in a state where we can only use a policy of unlimited because changing it to anything else will prevent a deployment from being run because it is busy applying the new retention policy (which always timesout). However, we can’t very many new deployments because we are almost out of disk space.


HI Brian,

If all you need is to free space on the tentacle without triggering a deployment, you could use the Script console to run a script on the tentacle and delete files using some powershell.

If you delete the contents of the packages folder, which holds all the nuget packages on the tentacle, you should free up most of the occupied space. On a default install that folder is on C:\Octopus\Applications\ .Tentacle.

If you need help writing the Powershel script, let me know the exact path of your packages folder and i’ll write it up for you.



I’d agree with Brian.
I think it would have been safer to allow us to apply a policy by clicking a button rather than forcing us to go into a folder and delete random stuff…

This is a significant problem for me as well. It would be nice if we could click a “force apply retention policy” or something on a per-(host * project) basis.


There’s a uservoice suggestion open for a dedicated button to trigger retention policies on Tentacles. It currently has 0 votes, so it could really use some of yours to gain some momentum.