文档

​
​

Development

User Acquisition

Monetization

工业

Unity Version Control

DevOps

On-prem

Gluon

Editor plug-in

Open Unity Dashboard

Unity Version Control

此页面不支持所选语言。
​
​
Unity Version Control
  • Overview
  • Cloud Repositories organization update
  • Installation
  • Use UVCS with the Unity Editor
  • Unity Version Control plugins
  • Concepts
  • Tutorials
  • On-Prem
  • Gluon
  • CLI and shortcut references
    • Unity Version Control CLI
      • acl
      • activateuser
      • add
      • admin
      • annotate
      • api
      • applylocal
      • archive
      • attribute
      • autocomplete
      • branch
      • changelist
      • changerevisiontype
      • changeset
      • changeuserpassword
      • checkconnection
      • checkin
      • checkout
      • checkselectorsyntax
      • clone
      • codereview
      • configure
      • crypt
      • deactivateuser
      • diff
      • diffmetrics
      • fastexport
      • fastimport
      • fileinfo
      • find
      • getconfig
      • getfile
      • getrevision
      • getstatus
      • gettaskbranches
      • getworkspacefrompath
      • getworkspaceinfo
      • help
      • history
      • iostats
      • issuetracker
      • label
      • licenseinfo
      • linktask
      • list
      • listusers
      • location
      • lock
      • log
      • merge
      • move
      • objectspec
      • partial
      • patch
      • profile
      • pull
      • purge
      • push
      • query
      • remove
      • repository
      • revert
      • setowner
      • shelveset
      • show-find-objects
      • showacl
      • showcommands
      • showowner
      • showpermissions
      • support
      • switch
      • sync
      • trigger
      • tube
      • undelete
      • undo
      • undochange
      • undocheckout
      • undocheckoutunchanged
      • update
      • version
      • whoami
      • workspace
      • workspacestatus
      • xlink
    • CLI help
    • Pipe commands
    • cm find
    • Windows keyboard shortcuts
  • Release Notes
  1. Unity Version Control (previously Plastic SCM)

ARCHIVE

Archive items with the Unity Version Control CLI.
阅读时间4 分钟
最后更新于 10 个月前

Description

Archives data in external storage.

Usage

cm archive | arch <revspec>[ ...] [-c=<str_comment>] [--file=<base_file>]
(Extracts data from the repository and stores it on external storage.)
cm archive | arch <revspec>[ ...] --restore
(Restores previously archived revisions back into the repository.)

Options

Option / Argument

Description

-cSets a comment in the archive storage files to create.
--fileName prefix and (optional) path for the new archive data files.
--restoreRestores previously archived data from generated archive files. The external storage location and the externaldata.conf file must be available at the moment of the revision restoration. See Remarks for more information.
revspecOne or more revision specs. (Use 'cm help objectspec' to learn more about revspecs.)

Help

Remarks

This command extracts data from the repository database and store it on external storage, saving database space. The command can also restore (--restore) previously archived revisions back into the repository database.
Use 'cm help objectspec' to learn how to specify a revspec.
The user running this command must be the UVCS server administrator (repository server owner) to be allowed to complete the operation.
Every data segment from the specified revisions will be stored in a different file, with a name starting with the value defined by the --file argument. This argument can contain either a full path value including a prefix for future archive files or just this prefix value.
Once archived, the data from the specified revisions will be accessible in two ways:
  1. From the client: The client will detect if the data was archived and it will prompt the user to enter the location of the files. Users can configure the external data location by creating a file named externaldata.conf (at the standard configuration files locations, using the same rules that apply for the client.conf file) containing the paths where archived data have been located.
  2. From the server: This way users won't have to know whether the data was archived or not, since requests will be transparently resolved by the server. To do so, the administrator will create a file called externaldata.conf in the server directory and will fill it with the paths where the archived volumes are.
To unarchive (restore) a revision (or set of revisions), the archived files must be accessible from the client. Hence, it is not possible to unarchive data being resolved by the server (method 2) because the client will not be able to identify it as archived. If method 2 is used, to unarchive successfully, the administrator will have to edit the externaldata.conf server file first to remove access to the archived files which have to be unarchived.

Archive example

  1. Archive one revision: cm archive Assets/RoofTextures/Textures/Wooden_Roof_05.png --file=/Users/ruben/archive/battle
See the archived revision in the specified output path: ls -al /Users/ruben/archive/battle* -rw-r--r-- 1 ruben staff 2220039 Nov 9 10:52 /Users/ruben/archive/battle-100280-167

Unarchive (restore) example

  1. Add the output archive folder to the externaldata.conf file: vi /Users/ruben/.plastic4/externaldata.conf /Users/ruben/archive
  2. Unarchive the revision: cm archive Assets/RoofTextures/Textures/Wooden_Roof_05.png --restore
Set the PLASTICEDITOR environment variable to specify an editor for entering comments. If the PLASTICEDITOR environment variable is set, and the comment is empty, the editor will be automatically launched to allow you to specify the comment.

Reading input from stdin

The 'archive' command can read paths from stdin. To do this, pass a single dash "-". Example: cm archive -
Paths will be read until an empty line is entered. This allows you to use pipe to specify which files to archive. Example:
dir /S /B *.c | cm archive -
(In Windows, archives all .c files in the workspace.)

Examples

cm archive bigfile.zip#br:/main
(Archives the last revision of 'bigfile.zip' in branch 'main'.)
cm archive bigfile.zip#br:/main --restore
(Restores the archived revision.)
cm archive rev:myfile.pdf#cs:2 -c="big pdf file" --file=c:\arch_files\arch
(Archives the revision with changeset 2 of myfile.pdf in 'c:\archived_files' folder. The archived file name will start with 'arch' (for example, arch_11_56).)
cm find "revs where size > 26214400" --format="{item}#{branch}"
--nototal | cm archive -c="volume00" --file="volume00" -
(Archives all the files bigger than 25Mb on files starting with name 'volume00'.)

Copyright © 2026 Unity Technologies
法律信息隐私政策CookiesDocumentation Terms of Use请勿出售或分享我的个人信息您的隐私选择(Cookie 设置)

“Unity”、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属公司在美国和其他地方的商标或注册商标(此处查看更多信息)。其他名称或品牌是其各自所有者的商标。

为方便起见,一些页面是机器翻译的,可能包含不准确的内容。如有信息不一致的情况,以英文版本为准。

  • 在本页上
    • Description

      • Usage

      • Options

    • Help

      • Remarks

        • Archive example

        • Unarchive (restore) example

      • Reading input from stdin

      • Examples


报告此页面的问题