Apache HTTP Server Version 2.5
htcacheclean
is used to keep the size of
mod_cache_disk
's storage within a given size limit, or
limit on inodes in use. This tool can run either manually or in daemon mode.
When running in daemon mode, it sleeps in the background and checks the cache
directory at regular intervals for cached content to be removed. You can stop
the daemon cleanly by sending it a TERM or INT signal. When run manually, a
once off check of the cache directory is made for cached content to be
removed. If one or more URLs are specified, each URL will be deleted from
the cache, if present.
htcacheclean
[ -D ]
[ -v ]
[ -t ]
[ -r ]
[ -n ]
[ -Rround ]
-ppath
[ -llimit ]
[ -Llimit ]
htcacheclean
[ -n ]
[ -t ]
[ -i ]
[ -Ppidfile ]
[ -Rround ]
-dinterval
-ppath
[ -llimit ]
[ -Llimit ]
htcacheclean
[ -v ]
[ -Rround ]
-ppath
[ -a ]
[ -A ]
htcacheclean
[ -D ]
[ -v ]
[ -t ]
[ -Rround ]
-ppath
url
-dinterval
-D
, -v
and -r
options. To shutdown the daemon cleanly, just send it
a SIGTERM
or SIGINT
.-D
-d
option. When doing a dry run and
deleting directories with -t
, the inodes reported deleted
in the stats cannot take into account the directories deleted, and will
be marked as an estimate.-v
-d
option.-r
-d
option and implies
the -t
option.-n
htcacheclean
will sleep from time to time
so that (a) the disk IO will be delayed and (b) the kernel can schedule
other processes in the meantime.-t
-ppath
CacheRoot
directive.-Ppidfile
-Rround
-llimit
B
to the
number). Attach K
for Kbytes, M
for
MBytes or G
for Gbytes.-Llimit
K
, M
or G
suffix can also be
used.
-i
-d
option.-a
-A
If htcacheclean
is passed one or more URLs, each URL will
be deleted from the cache. If multiple variants of an URL exists, all
variants would be deleted.
When a reverse proxied URL is to be deleted, the effective URL is constructed from the Host header, the port, the path and the query. Note the '?' in the URL must always be specified explicitly, whether a query string is present or not. For example, an attempt to delete the path / from the server localhost, the URL to delete would be http://localhost:80/?.
By passing the -a
or -A
options to
htcacheclean
, the URLs within the cache will be listed
as they are found, one URL per line. The -A
option
dumps the full cache entry after the URL, with fields in the
following order:
htcacheclean
returns a zero status ("true") if all
operations were successful, 1
otherwise. If an URL is
specified, and the URL was cached and successfully removed,
0
is returned, 2
otherwise. If an error
occurred during URL removal, 1
is returned.