The "archive" Command

The command accurev archive processes one or more versions of file elements, shifting the versions" container files from normal status to archived status. The command has this format:

accurev archive [ -E <element-type(s)> ] [ -i ] [ -p <depot> ]
[ -a | -I <stream-category(s)> ] [ -s <stream> ]
[ -t <transaction-range> ] [ -c <comment> ] [ -R ]
[ -Fx ] { -l <list-file> | <element-list> }

Determining Which Versions to Archive

archive determines the set of versions to archive as follows:

  • Start with a particular set of file elements, which you specify as command-line arguments in the <element-list>, or in a list-file (plain-text or XML format). You can include directories in this list; in this case, use the -R option to include the recursive contents of those directories.

  • Optionally, take the subset of versions whose element type matches the specification made with -E. (Note that different versions of an element can have different element types.)

  • Optionally, take the subset of versions that were created in a particular streams (-s, for example, your current workspace stream). You can also archive versions from all streams in the depot (-a).

  • Optionally, take the subset of versions created in a specific transaction, or range of transactions:

    -t <number>single transaction
    -t <number>-<number>range of transactions

  • In addition to the multiple sub-settings of versions described above, you can use the -I option to include versions in the set, based on where in the stream hierarchy they are referenced. For example, you can include versions that were not originally included in the set because they are referenced by one or more snapshots.

If you don't use the -a or -I option, archive refuses to archive any version that is currently visible in any stream or snapshot. Specified versions that are already archived are silently ignored.

Back to top

Dry Run Capability

Using the -i option (in addition to the other options described above) generates an XML-format listing of the desired versions, but does not perform any actual archiving work. It is highly recommended that you do this "dry run" before actually archiving any versions, to avoid any surprises.

Back to top

Archiving the Versions

After determining which versions to process, the archive command moves a version's container file from a "normal" location under the data directory:


... to a corresponding "archived" location in the archive_gateway/out area:


archive also marks the version as "archived" in the database.

Subsequent attempts by AccuRev commands to retrieve the contents of the archived version will fail.


The changes made by this command are recorded in the database as a transaction of type archive. You can use the -c option to specify a comment string to be stored in this transaction. You can search for particular comment strings when using the hist command to locate previous archive transactions. See Using "hist" to Research Previous "archive" Commands.

Back to top