Windows temporary directory cleanup tool.
To develop the program, .NET SDK 6.0 or later is required.
Simply execute Vacuum.exe
. It will remove any entries in your temp directory
that weren't touched in the last month.
"Entry" is either a file or a directory. A directory counts as "touched" if any of its children was touched in the last month. Vacuum considers the following dates when examining the files (as they're reported by the filesystem):
- creation date
- last write date
Main command-line arguments:
-
(-d|--directory) <path>
: path to the temporary directory which should be cleaned up. Falls back toPath.GetTempPath
by default (which uses certain environment variables to determine the path). -
(-p|--period) <number>
: number of days for an entry to be untouched before being deleted by Vacuum. 30 by default. -
(-s|--space) (<number>|<number>k|<number>m|<number>g)
: amount of space to clean up (k
= kibibytes,m
= mebibytes,g
= gibibytes). In space-cleaning mode, Vacuum will still clean up the oldest items first. -
(-F|--free) (<number>|<number>k|<number>m|<number>g)
: amount of space to be free after the clean (k
= kibibytes,m
= mebibytes,g
= gibibytes). The oldest items will still be cleaned up first.Pro Tip:
If you use PowerShell, then it's possible to easily pass arbitrary sizes in bytes without any need for calculation. Try the following in shell:
$ Vacuum --space $(10gb)
This will call
Vacuum --space 10737418240
(i.e. 10 gibibytes). -
(-f|--force)
: forces Vacuum to delete the entries it wasn't able to recycle. -
(-w|--what-if)
: only prints the files that would be deleted instead of actually deleting them. -
(-v|--verbose)
: show exception call stacks.
Consult the embedded help system for the detailed parameter manual:
$ Vacuum.exe --help
To download Vacuum binary distribution, please visit GitHub releases section.
The project is distributed under the terms of the MIT license.
The license indication in the project's sources is compliant with the REUSE specification v3.3.