p4 storage
Display, verify, or update physical archive storage.
Syntax
p4 [g-opts] storage [-v [-q]] [-c change] [-T tags -F filters] [-m max] archive... p4 [g-opts] storage -u [-c change] [-T tags -F filters] [-m max] archive... p4 storage -d [-c change] [-y] [-D secs] [ -t target ] [-q] archive... p4 storage -w p4 storage -l start|pause|restart|wait|status|cancel //depotdirectory/...
Description
A user with admin access can display information about the server archive files and their usage with
p4 storage [-v [-q]] [-c change] [-T tags -F filters] [-m max] archive...
The -l option provides a group of commands to locate orphaned archive files and mark them for removal by the storage -d command.
See also "Reclaiming disk space by removing orphaned archive files" under Managing disk space in Helix Core Server Administrator Guide.
The fields that storage displays are:
lbrFile | the path of the archive file |
lbrRev | the revision of the archive file |
lbrType |
the file type of the archive file, such as text+C See File types. |
lbrRefCount | how many revs refer to the librarian file |
headTime | timestamp of when the record was written |
filesize | size of the librarian file |
digest | MD5 digest of the librarian file |
serverSize | Size of the librarian file on the server at the time that revison was submitted or shelved |
compCksum | MD5 of the librarian file containing the revision on the server if the file is compressed and submit.storagefields is 1 |
Additional fields when the -v flag is specified:
actualSize | actual size of librarian file |
actualDigest | actual MD5 digest of librarian file |
status | outcome of verify, OK, BAD or MISSING |
Options
|
Verifies that the specified archive files are intact. Computes and displays the digest of each archive.
p4 storage -v is similar to p4 verify except that:
|
||||||||||||||||||||||||||
|
Computes and saves the digest only for revisions that have no saved digest. |
||||||||||||||||||||||||||
|
Minimizes the output of the storage -v command, displaying only errors from mismatched digests or unreproducible revisions. |
||||||||||||||||||||||||||
-d |
Deletes unreferenced archives. If the specified archive has a reference count of 0, the database row describing the archive is removed as well as the revision of the underlying archive. Without the -y as confirmation, the command merely lists the candidate files and revisions it would remove. With the -y as confirmation, files and revisions as well as zero referenced storage records are removed. The expiry time is set by the lbr.storage.delay configurable. The expiry time is intended to protect the storage records and archive files of in-progress submits and in-progress shelves from being considered for deletion. To override this configurable, specify the -D secs parameter on the command line. Archives with a reference count of 0 are rare, but can be created by:
The listing of the candidate revisions can be suppressed with the -q option. The -t target option copies the unreferenced archives to the target directory you specify before deleting the unreferenced archives from the server's P4ROOT. |
||||||||||||||||||||||||||
-c | Applies to the specified changelist. | ||||||||||||||||||||||||||
-T |
Applies to the specified tags, which can be specified using a comma- or space-delimited list. Example: -T "lbrFile, lbrRev" |
||||||||||||||||||||||||||
-F |
Applies to the specified filter. lists only records satisfying the filter expression. This filter syntax is similar to the one used for jobs -e jobview and is used to evaluate the contents of the fields in the preceding list. Filtering is case-sensitive. Example: -v -F "lbrRefCount = 1 & status=OK" |
||||||||||||||||||||||||||
-m | Limits output to the specified number of records | ||||||||||||||||||||||||||
|
Provides a message that indicates when the upgrade process is complete by displaying "The storage upgrade process is complete". For details, see Helix Core Server Administrator Guide on upgrading to 2019.1 or later. |
||||||||||||||||||||||||||
-l
|
Allows the administrator to create, pause, restart and cancel background processes that can locate and mark orphan files. This process looks for files in the specified //depotdirectory and its subdirectories that match the naming convention for the server's archive file format. Each file that is found, along with its revision, is checked for a matching entry in the db.storage table. If no such entry is found, a new record is created that describes the file and revision combination with a reference count of 0. A later call to p4 storage -d will delete both those records with zero references and the associated the archive revision. p4 storage -l has subcommands:
Warning
|
||||||||||||||||||||||||||
|
See Global options. |
Example of a possible workflow
Locating the orphaned files
To start the scan:
p4 storage -l start //depot/path/...
To get the status of the scan:
p4 storage -l status //depot/path/...
To pause the scan:
p4 storage -l pause //depot/path/...
To end the pause and resume the scan:
p4 storage -l restart //depot/path/...
To cancel the scan:
p4 storage -l cancel //depot/path/...
A scan remains in the system until it is canceled. To re-run a scan, first pause the scan (if it is active), then cancel the scan (even if it has completed or resulted in an error).
Reclaim disk space on the server
To save the orphaned files to your target directory and delete the zero references and associated the archive files from the server's P4ROOT:
p4 storage -d -y -t /myTargetDirectory //depot/path/...
where /myTargetDirectory is any operating system target directory, and, for Windows, might be something like D:\myCopyOfOrphanedFiles
Usage Notes
Can File Arguments Use Revision Specifier? | Can File Arguments Use Revision Range? | Minimal Access Level Required |
---|---|---|
No |
No |
|
Your search for returned result(s).