Administration tool for the a-rex cache.
cache-clean [-h] [-s] [-m NN -M NN] [-E N] [-D debug_level]
[ -c <arex_config_file> | <dir1> [<dir2> [...]] ]
cache-clean is a tool for administrators of ARC server installations to safely remove A-REX cache data and to provide an overview of the contents of the cache. It is used by the A-REX to automatically manage cache contents.
There are two modes of operation - printing statistics and deleting files. If -s is used, then statistics are printed on each cache. If -m and -M are used then files in each cache are deleted if the free space on the file system is less than that given by -m, in the order of least recently accessed, until the free space is equal to what is specified by -M. If -E is used, then all files accessed less recently than the given time are deleted. -E can be used in combination with -m and -M but deleting files using -E is carried out first. If after this the cache free space is still less than that given by -m then cleaning according to those options is performed. Cache directories are given by dir1, dir2.. or taken from the config file specified by -c or the ARC_CONFIG environment variable.
-h - print short help
-s - print cache statistics, without deleting anything. The output displays for each cache the number of deletable (and locked) files, the total size of these files, the percentage usage of the file system in which the cache is stored, and a histogram of access times of the files in the cache.
-m - the minimum free space (as % of the file system) at which to start cleaning
-M - the minimum free space (as % of the file system) at which to stop cleaning
-E - files accessed less recently than the given time period will be deleted. Example values of this option are 1800, 90s, 24h, 30d. The default when no suffix is given is seconds.
-D - debug level. Possible values are FATAL, ERROR, WARNING, INFO, VERBOSE or DEBUG. Default level is INFO.
-c - path to an A-REX config file, xml or ini format
This tool is run periodically by the A-REX to keep the size of each cache within the limits specified in the configuration file. Therefore cleaning should not be performed manually, unless the cache size needs to be reduced temporarily. For performance reasons it may however be desirable to run cache-clean independently on the machine hosting the cache file system, if this is different from the A-REX host. The most useful function for administrators is to give an overview of the contents of the cache, using the -s option.
Within each cache directory specified in the configuration file, there is a subdirectory for data (data/) and one for per-job hard links (joblinks/). See the A-REX Administration Guide for more details. cache-clean should only operate on the data subdirectory, therefore when giving dir arguments they should be the top level cache directory. cache-clean will then automatically only look at files within the data directory.
cache-clean -m20 -M30 -E30d -D VERBOSE -c /etc/arc.conf
Cache directories are taken from the configuration file /etc/arc.conf and all cache files accessed more than 30 days ago are deleted. Then if the free space in a cache is below 20%, data is deleted until the free space reaches 30%. Verbose debug output is enabled so information is output on each file that is deleted.
APACHE LICENSE Version 2.0
ARC software is developed by the NorduGrid Collaboration (http://www.nordugrid.org), please consult the AUTHORS file distributed with ARC. Please report bugs and feature requests to http://bugzilla.nordugrid.org