# phpman > man > htcacheclean(8)

[HTCACHECLEAN(8)](https://www.chedong.com/phpMan.php/man/HTCACHECLEAN/8/markdown)                             htcacheclean                             [HTCACHECLEAN(8)](https://www.chedong.com/phpMan.php/man/HTCACHECLEAN/8/markdown)



## NAME
       htcacheclean - Clean up the disk cache


## SYNOPSIS
       **htcacheclean** [ -**D** ] [ -**v** ] [ -**t** ] [ -**r** ] [ -**n** ] [ -**R**_round_ ] -**p**_path_ [ -**l**_limit_ ] [ -**L**_limit_ ]


       **htcacheclean**  [  -**n** ] [ -**t** ] [ -**i** ] [ -**P**_pidfile_ ] [ -**R**_round_ ] -**d**_interval_ -**p**_path_ [ -**l**_limit_ ] [
       -**L**_limit_ ]


       **htcacheclean** [ -**v** ] [ -**R**_round_ ] -**p**_path_ [ -**a** ] [ -**A** ]


       **htcacheclean** [ -**D** ] [ -**v** ] [ -**t** ] [ -**R**_round_ ] -**p**_path_ _url_



## SUMMARY
       **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  inter‐
       vals  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.



## OPTIONS
### -d
              Daemonize and repeat cache cleaning every _interval_ minutes. This  option  is  mutually
              exclusive with the **-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

### -r
              you may get garbage in the cache). This option is mutually exclusive with the  **-d**  op‐
              tion and implies the **-t** option.

### -n
              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
              some configurations the large number of directories created may require attention.  If
              your  configuration requires a very large number of directories, to the point that in‐
              ode or file allocation table exhaustion may become an issue, use of this option is ad‐
              vised.

### -p
              specified with the CacheRoot directive.

### -P
              Specify _pidfile_ as the name of the file to write the process ID to when daemonized.

### -R
              Specify _round_ as the amount to round sizes up to, to compensate for disk block  sizes.
              Set to the block size of the cache partition.

### -l
              Specify  _limit_  as the total disk cache size limit. The value is expressed in bytes by
              default (or attaching **B** to the number). Attach **K** for Kbytes, **M** for  MBytes  or  **G**  for
              Gbytes.

### -L
              Specify _limit_ as the total disk cache inode limit. **K**, **M** or **G** suffix can also be used.

### -i
              tion is only possible together with the **-d** option.

### -a
              once for each variant.

### -A
              lowing order: url, header size, body size, status, entity version, date,  expiry,  re‐
              quest time, response time, body present, head request.


## DELETING A SPECIFIC URL
       If  **htcacheclean** is passed one or more URLs, each URL will be deleted from the cache. If mul‐
       tiple 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/>?**.


## LISTING URLS IN THE CACHE
       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:



       url    The URL of the entry.

       header size
              The size of the header in bytes.

       body size
              The size of the body in bytes.

       status Status of the cached response.

       entity version
              The number of times this entry has been revalidated without being deleted.

       date   Date of the response.

       expiry Expiry date of the response.

       request time
              Time of the start of the request.

       response time
              Time of the end of the request.

       body present
              If 0, no body is stored with this request, 1 otherwise.

       head request
              If 1, the entry contains a cached HEAD request with no body, 0 otherwise.


## EXIT STATUS
       **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.




Apache HTTP Server                           2019-08-09                              [HTCACHECLEAN(8)](https://www.chedong.com/phpMan.php/man/HTCACHECLEAN/8/markdown)
