CacheCleaner.exe command-line switches
CacheCleaner is an executable that can be used to explicitly purge the Content Distribution cache. By default, the Content Distribution cache is not purged unless there is an active download. In most cases, available disk space is not really an issue, but there may be circumstances where you may want to manage the cache to keep the disk usage overhead to a minimum. Please refer to Cache management for further information about managing the cache.
It is installed as part of Content Distribution and the format of the command-line is:
CacheCleaner.exe -switch
Where switch is one of the following (case-sensitive).
Switch name |
Default value |
Range |
Description |
---|---|---|---|
-CachePriority |
1 |
1-9 |
Only cache contents with a priority equal to or lower than the CachePriority are purged. Used in conjunction with Pkgsize to emulate the behavior of the cache cleaner when an actual package is being downloaded. |
-Debug |
|
|
Sets the debug level for CacheCleaner and it can be passed on the command-line. If it is not, the value from Content Distribution registry is used. If Debug is already defined, using this argument adds to the logging level. |
-Deleteall |
|
|
Deletes all cache content where the priority is less than or equal to the value for Force. If the command-line does not include Force, then Deleteall deletes all cache content where the priority is 1. Works in conjunction with the Force. |
-DeletePkg |
|
|
The ID of the package or content to be deleted from the cache. The value must be set to the PackageID or ContentID string that identifies the content to be deleted. Must be used in conjunction with PkgVer. Copy
Copy
|
-Force |
|
|
Content whose cache priority is less than or equal to the CachePriority value are purged. Used in conjunction with the Deleteall and MaxCacheAge. |
-MaxCacheAge |
|
1-1461 |
The maximum number of days before the contents of a cache is purged. If set, CacheCleaner deletes cache contents which are older than this value. This argument is ignored if DeletePkg and Deleteall is used on the command-line. If the command-line includes Force, all caches with a priority less than or equal to CachePriority will have their content purged. If CachePriority is not included on the command-line, all caches with a priority=1 will have their content purged. |
-PercentAvailableDisk |
10 |
1-99 |
Deletes the lowest cache priority content until the set percentage of available disk is available. |
-Pkgsize |
|
|
Only caches with a priority equal to or lower than the CachePriority value will have their contents purged. Used in conjunction with CachePriority to emulate the behavior of the cache cleaner when an actual package is being downloaded. Determine the space to be cleared when running cachecleaner.exe with PercentAvailableDisk. The PkgSize value is by default specified in bytes but can be set to MB by appending MB to the value. For example, the following are equivalent: -Pkgsize=1048576
|
-PkgVer |
|
|
Identifies the content version to be deleted and must be used in conjunction with DeletePkg. Deletes content from both the Content Distribution and Configuration Manager client caches that corresponds to the version number and the Package ID (or Content ID). The special value -PkgVer=* may be used when the user is unsure of the specific version of the package in the cache. Setting -PkgVer=* will delete any version of the content with the ID specified in the DeletePkg argument from the Content Distribution cache only – it will not delete from the Configuration Manager client cache. If you want to remove Application or Software Updates content, then the -PkgVer will usually need to be set to 1. |
If the Content Distribution cache is deleted while another client is accessing it, the other client will recover by downloading directly from the DP. This is by design and ensures recovery occurs in order to complete a successful download.
CacheCleaner examples
In the following examples, there is no requirement to specify the path to CacheCleaner.exe because the path to Content Distribution executables is set in the PATH environment variable:
Example |
Description |
---|---|
Set the cache cleaner to run as a Configuration Manager program. |
You can set the cache cleaner to run as a Configuration Manager program and advertise it to all Content Distribution systems in a single operation. You can also schedule this as a regular housekeeping job, ensuring that the cache is kept under control automatically. To purge the cache when the total free disk space is at 20% run: Copy
|
Ensure that content in the cache is not kept for more than 30 day. |
To ensure that content in the cache is not kept for more than 30 days, run: Copy
|
Delete a particular package and version. |
To delete a particular package and version, run: Copy
|
Purge the contents of a cache with a priority of 3 or lower. |
To purge the contents of a cache with a priority of 3 or lower, run: Copy
|
Purge the contents of a cache with a particular priority and size. |
To purge the contents of a cache with a particular priority and size, run: Copy
|