About Disk Cleanup Utility
The Disk Cleanup Utility can be used to remove old files from the file system that are no longer needed. This utility is designed to help administrators reclaim disk space.
The disk clean-up utility can be used from the command line using the fmos disk-cleanup command, or using the FMOS Server Control Panel. The utility has two operational modes: analyze and clean.
- In Analyze Mode, the disk clean-up utility scans for files identified by the specified selection profiles and estimates the amount of disk space that would be reclaimed by removing them. In this mode, no files are actually removed from the file system.
- In Clean Mode, the disk clean-up utility will remove any files identified by the specified selection profiles. When it is finished, it will report on the number of files removed and the amount of disk space that was reclaimed by removing them.
The disk clean-up utility includes several predefined selection profiles to classify files on the file system. When run in either analyze or clean mode, the utility takes a set of selection profiles and searches for files matching the properties specified by those profiles.
When using the CLI, the list of available selection profiles can be viewed by using the --list-profiles or -L argument.
The CLI accepts one or more selection profiles as positional arguments. Additionally, a pseudo-profile all can be used to select all available profiles. When using the all selection, it may be necessary to exclude one or more profiles, which can be indicated by prefixing the profile key with a hyphen-minus symbol.
In addition to selection profiles, the files to remove can be further restricted by their age. The age of a file refers to how much time has elapsed since the file was last modified. By default, the command-line interface restricts both analyze and clean mode to files that are older than 30 days. To specify a different age, use the --age or -a argument.
Examples
- Run analyze mode on the default selection: fmos disk-cleanup
- Run analyze mode on all available profiles: fmos disk-cleanup all
-
Run clean mode on all profiles, except for log files: fmos disk-cleanup --clean -- all -logs
When specifying an exclusion using the hyphen-minus syntax, the double hyphen-minus is required. This is a limitation of the command-line argument parser used by the FMOS command; it is needed to distinguish the exclusion from short-form optional arguments.
Example
Run clean mode on all crash dumps older than one day: fmos disk-cleanup - -clean - -age 1 crash-dumps