p4 cachepurge


Reclaim disk space on a replicated server.


p4 [g-opts] cachepurge [-a | -f n | -m n | -s n ] [-i n -n -R -S n -O -D file ...]


A replica used as a standby spare or for disaster recovery maintains a complete copy of the master server's versioned file archives. Replicas that are used for other purposes might not need to hold a copy of the content of every version of every file. If a replica is not needed for disaster recovery, you can reclaim disk space on it by periodically deleting versioned files. This is only safe to do if you have a backup of these files.

The p4 cachepurge command allows an administrator to reclaim disk space for those replicated servers that are not used for disaster recovery. File content is deleted only from the replica, not from the master server nor from any other replica. If a command that accesses purged file content is issued to this replica, the file is retrieved from the master server.

Each time the p4 cachepurge command runs, it attempts to delete enough file content from the replica to achieve the goal set by the values specified for the command parameters.


-i n

Repeat the command every n seconds. If you omit this option, the command runs only once.


Display a preview of the cachepurge operation without deleting any files.


Delete all file content. This option reclaims the maximum amount of disk space, but any file content must be retrieved from the master. If the -O option is not specified, file names are used to determine order of deletion.

-f n

Delete sufficient file content to leave n number of bytes of free space for the file system.

-m n

Delete n file revisions. The amount of space this frees up depends on the size of the files.

-s n

Delete n bytes of file data. This can be helpful in those cases when you can predict the growth rate of file system resources.

-D file...

Limit action of command to the specified set of files.


Delete files in the order specified by the -O option. If the -O option is not specified, file names are used to determine order of deletion.

-S n

Do not delete the n most recent revisions of each file. For example, specifying -S 1, means that the head revision of each file is retained in the replica's cache if it is already there.


Delete the files from the oldest to the newest; that is, delete older files before deleting newer files.


See the “Global Options” section.

Usage Notes

Can File Arguments Use Revision Specifier?

Can File Arguments Use Revision Range?

Minimal Access Level Required