Reviewed-by: Sabelnikov, Dmitriy <dmitriy.sabelnikov@t-systems.com> Co-authored-by: weihongmin1 <weihongmin1@huawei.com> Co-committed-by: weihongmin1 <weihongmin1@huawei.com>
16 KiB
Restoring Objects from the Cold Storage
Function
You can use this command to restore a specified cold object or restore cold objects with a specific prefix in batches.
Command Line Structure
- Windows
- Restoring an object
obsutil restore obs://bucket/key [-d=1] [-t=xxx] [-versionId=xxx] [-fr] [-o=xxx] [-config=xxx]
- Restoring objects in batches
obsutil restore obs://bucket[/key] -r [-f] [-v] [-d=1] [-t=xxx] [-o=xxx] [-j=1] [-config=xxx]
- Restoring all objects in a specific directory at a time
obsutil restore obs://bucket/folder/ -r [-f] [-v] [-d=1] [-t=xxx] [-o=xxx] [-j=1] [-config=xxx]
- Restoring an object
- macOS or Linux
- Restoring an object
./obsutil restore obs://bucket/key [-d=1] [-t=xxx] [-versionId=xxx] [-fr] [-o=xxx] [-config=xxx]
- Restoring objects in batches
./obsutil restore obs://bucket[/key] -r [-f] [-v] [-d=1] [-t=xxx] [-o=xxx] [-j=1] [-config=xxx]
- Restoring all objects in a specific directory at a time
./obsutil restore obs://bucket/folder/ -r [-f] [-v] [-d=1] [-t=xxx] [-o=xxx] [-j=1] [-config=xxx]
- Restoring an object
Examples
- In Windows, run obsutil restore obs://bucket-test/key to restore a single object whose storage class is cold.
obsutil restore obs://bucket-test/key Start at 2024-09-30 08:56:17.9537365 +0000 UTC Start to restore object [key] in the bucket [bucket-test] successfully, cost [252] ms, request id [0000019242250F754015F23EE0B7876E]
- In Windows, run obsutil restore obs://bucket-test -r -f to restore all objects whose storage class is cold in the bucket.
obsutil restore obs://bucket-test -r -f Start at 2024-09-30 08:57:11.3565648 +0000 UTC [================================================] 100.00% 3s Succeed count: 12 Failed count: 0 Metrics [max cost:264 ms, min cost:54 ms, average cost:119.33 ms, average tps:19.70] Task id: 96f104ee-d0bf-40ff-95dd-31dec0d8f4f4
Parameter Description
Parameter |
Optional or Mandatory |
Description |
|---|---|---|
bucket |
Mandatory |
The bucket name |
key |
Mandatory for restoring a single object whose storage class is cold Optional for batch restoring objects whose storage class is cold |
The name of the object to be restored or the name prefix of the objects to be restored in batches NOTE:
If this parameter is left blank when batch restoring objects, all objects whose storage class is cold in the bucket are restored. |
d |
Optional (additional parameter) |
The storage duration after objects whose storage class is cold are restored, in days. The value ranges from 1 to 30. The default value is 1. |
t |
Optional (additional parameter) |
The options for restoring objects. The value can be:
NOTE:
|
versionId |
Optional for restoring a single object whose storage class is cold (additional parameter) |
The version ID of the to-be-restored object whose storage class is cold |
fr |
Optional for restoring a single object whose storage class is cold (additional parameter) |
Generates an operation result file when restoring a single object whose storage class is cold. |
f |
Optional for batch restoring objects whose storage class is cold (additional parameter) |
Runs in force mode. |
r |
Mandatory for batch restoring objects whose storage class is cold (additional parameter) |
Restores objects whose storage class is cold in batches by object name prefix. |
v |
Optional for batch restoring objects whose storage class is cold (additional parameter) |
Restores versions of objects whose storage class is cold in batches by object name prefix. |
o |
Optional (additional parameter) |
The folder that stores the result files. After the command is executed, result files (possibly success and failure files) will be created in the specified folder. The default value is .obsutil_output, a subfolder in the user's home directory where obsutil commands are executed. NOTE:
|
j |
Optional for batch restoring objects whose storage class is cold (additional parameter) |
The maximum number of concurrent tasks for batch restoring objects whose storage class is cold. The default value is the value of defaultJobs in the configuration file. NOTE:
The tool ensures that this value is at least 1. |
config |
Optional (additional parameter) |
The user-defined configuration file for executing the current command. For details about parameters that can be configured, see Configuration Parameters. |
payer |
Optional (additional parameter) |
Specifies that requester pays is enabled. Range: requester |
Response
Refer to Response for uploading an object.
