You need to enable JavaScript to run this app.
Torch Object Storage

Torch Object Storage

Copy page
Download PDF
Common commands
Restore objects (restore)
Copy page
Download PDF
Restore objects (restore)
You can use the restore command to restore archived objects.​
Notes​
  • Restoring objects from Archive incurs data retrieval costs. Restoring objects from Cold Archive or Deep Cold Archive incurs data retrieval costs and request costs. For more information, see Data retrievals and Requests.​
  • Restoring an object from Archive, Cold Archive or Deep Cold Archive creates a temporary copy for your access. This copy is stored in Standard Storage and incurs standard storage costs during the validity period. For billing details, see Storage of temporary copies.​
Command syntax​
​
​
Linux/macOS
Windows
​
  • Restore an object​
​
./tosutil restore tos://bucket/key [-f] [-versionId=xxx] [-d=1] [-tier=xxx] [-fr] [-o=xxx] [-bt=xxx] [-e=xxx] [-re=xxx] [-i=xxx] [-k=xxx] [-t=xxx] [-conf=xxx]​
​
  • Batch restore objects with a specified prefix​
​
./tosutil restore tos://bucket/[prefix] -r [-f] [-j=1] [-v] [-d=1] [-tier=xxx] [-o=xxx] [-bt=xxx] [-e=xxx] [-re=xxx] [-i=xxx] [-k=xxx] [-t=xxx] [-conf=xxx]​
​
​
​
​
Parameters​
For descriptions of common optional parameters, see Global options.​
​
Parameter​
Type​
Description​
bucket​
String​
Bucket name.​
key​
String​
Object name.​
prefix​
String​
The prefix used for filtering objects in batch restore operations.​
-r​
Bools​
Batch restore objects with a specified prefix.​
-j​
Integer​
The maximum concurrency for restoring objects in batches. This value is set to the "defaultJobs" value in the configuration file by default.​
-v​
Bools​
Batch restore objects with multiple versions that share the specified prefix.​
-f​
Bools​
Force the operation without prompting for confirmation.​
-versionId​
String​
Sets the version of the object to be restored. If this is not set, the latest version will be restored by default.​
-d​
Integer​
Sets how long object copies will be reserved. The default value is 1 day. Restoring an object creates a temporary copy that you can access, which will be automatically deleted once it expires. The unit is days.​
-tier​
Enum​
Restoration mode. The available options are Standard, Expedited, and Bulk. The default setting is Standard. The available restoration modes vary depending on where the object is stored.​
  • For objects stored in Archive, the only supported restoration mode is Standard, which restores objects within 1 minute.​
  • For objects stored in Code Archive, the supported restoration modes are:​
  • Expedited: Restores objects within 1 to 5 minutes.​
  • Standard: Restores objects within 2 to 5 hours.​
  • Bulk: Restores objects within 5 to 12 hours.​
  • For objects stored in Deep Code Archive, the supported restoration modes are:​
  • Standard: Restores objects within 12 hours.​
  • Bulk: Restores objects within 48 hours.​
-fr​
Bools​
Generate a result file when restoring a single object.​
-o​
String​
The folder where result files are stored. The default location is specified in the configuration file as defaultOutputDir.​
-bt​
String​
The type of the bucket. The options are as follows:​
  • fns: A flat namespace (FNS) bucket.​
  • hns: A hierarchical namespace (HNS) bucket.​
If the bucket type is not specified, the default will be the type obtained from the bucket metadata.​
​
Examples​
Restore an object​
Use the following command to restore the "image" object in the "bucketname" bucket, and set the validity period of the copy to 2 days and the restoration mode to "Standard".​
  • Command​
  • ​
    ./tosutil restore tos://bucketname/image -d=2 -tier=Standard​
    ​
  • Output​
  • ​
    Start at 2024-12-11 07:01:03.718647 +0000 UTC​
    ​
    Restore object [image] in the bucket [bucketname] successfully, cost [326], request id [b108015938af3609675938af-baa4376-1tLGiV-RO-cs-tos-front-azc-4]​
    ​
Batch restore objects with a specified prefix​
Use the following command to batch restore objects with the "Arp" prefix, and set the validity period of the copies to 2 days, and the restoration mode to "Standard".​
  • Command​
  • ​
    ./tosutil restore tos://bucketname/Ar -r -d=2 -tier=Standard​
    ​
  • Output​
  • ​
    Start at 2024-12-11 07:05:02.002142 +0000 UTC​
    ​
    [--------------------------------------------------] 100.00% tps:0.00 3/3 139ms​
    Succeed count is: 3 Failed count is: 0 ​
    Metrics [max cost:89 ms, min cost:35 ms, average cost:62.33 ms, average tps:20.83]​
    ​
    Task id is: 3dea6c5c-b78e-11ef-b734-8a8ce1fde7d0​
    ​
​
Last updated: 2025.12.17 18:33:44