Egress Switch – Large File Repository Cleanup

For sending encrypted e-mails and large files to external parties I use Egress Switch which we have deployed internally rather than using the cloud service. I like the product and it’s ease of use and functionality but that’s not what I want to talk about in this post.

If you have deployed this product yourself with the ability to host files internally (think private encrypted Dropbox accessible to external parties) then you will likely want a way to tidy up files on your repository. For me the simplest way was a scheduled task running a small PowerShell snipet –

get-childitem -Path "E:\Egress\File\Data" -Recurse | where {$_.LastWriteTime -le $(get-date).AddDays(-15)} | Remove-Item -Recurse

The above will iterate through the path defined and remove any files older than 15 days. This allows us to keep control of the large file repository and stop it consuming an inordinate amount of space. I am tempted to return to this code snipet in the future and perhaps add some extra functionality but for now it does the job.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.