Resuming a Failed Upload Task
Function
You can use this command to resume a failed upload task based on the task ID.
Command Line Structure
- In Windows
obsutil cp -recover=xxx [-arcDir=xxx] [-dryRun] [-f] [-u] [-vlength] [-vmd5] [-j=1] [-p=1] [-threshold=52428800] [-acl=xxx] [-sc=xxx] [-meta=aaa:bbb#ccc:ddd] [-ps=auto] [-include=*.xxx] [-exclude=*.xxx] [-timeRange=time1-time2] [-mf] [-o=xxx] [-cpd=xxx] [-clear] [-config=xxx] [-e=xxx] [-i=xxx] [-k=xxx] [-t=xxx]
- In Linux or macOS
./obsutil cp -recover=xxx [-arcDir=xxx] [-dryRun] [-f] [-u] [-vlength] [-vmd5] [-j=1] [-p=1] [-threshold=52428800] [-acl=xxx] [-sc=xxx] [-meta=aaa:bbb#ccc:ddd] [-ps=auto] [-include=*.xxx] [-exclude=*.xxx] [-timeRange=time1-time2] [-mf] [-o=xxx] [-cpd=xxx] [-clear] [-config=xxx] [-e=xxx] [-i=xxx] [-k=xxx] [-t=xxx]
Examples
- Take the Windows OS as an example. Run the obsutil cp -recover 104786c8-27c2-48fc-bc6a-5886596fb0ed -f command to resume the failed upload task.
obsutil cp -recover 104786c8-27c2-48fc-bc6a-5886596fb0ed -f Parallel: 3 Jobs: 3 Threshold: 524288000 PartSize: 5242880 Exclude: Include: VerifyLength: false VerifyMd5: false CheckpointDir: xxxx Task id: a628d6da-c562-4a1f-b687-4fa125de0dc3 OutputDir: xxxx [========================================================] 100.00% tps:35.71 2.02 KB/s 7.20MB/7.20MB 0s Succeed count is: 5 Failed count is: 0 Metrics [max cost:90 ms, min cost:45 ms, average cost:63.80 ms, average tps:35.71] Task id: a628d6da-c562-4a1f-b687-4fa125de0dc3
Parameter Description
Parameter |
Optional or Mandatory |
Description |
---|---|---|
recover |
Mandatory (additional parameter) |
ID of the upload task to be resumed
NOTE:
|
arcDir |
Optional (additional parameter) |
Path to which the uploaded files are archived |
dryRun |
Optional (additional parameter) |
Conducts a dry run. |
u |
Optional (additional parameter) |
Indicates incremental upload. If this parameter is set, each file can be uploaded only when it does not exist in the bucket, its size is different from the namesake one in the bucket, or it has the latest modification time.
CAUTION:
When you compare each local file with data in the bucket, a billable HEAD request is generated. For details, see Requests. |
vlength |
Optional (additional parameter) |
After the upload completes, check whether the sizes of the objects in the bucket are the same as those of the local files. |
vmd5 |
Optional (additional parameter) |
After the upload completes, check whether the MD5 values of the objects in the bucket are the same as those of the local files.
NOTE:
|
p |
Optional (additional parameter) |
Indicates the maximum number of concurrent multipart upload tasks when uploading a file. The default value is the value of defaultParallels in the configuration file. |
threshold |
Optional (additional parameter) |
Indicates the threshold for enabling multipart upload, in bytes. The default value is the value of defaultBigfileThreshold in the configuration file.
NOTE:
|
acl |
Optional (additional parameter) |
Access control policies that can be specified when uploading files. Possible values are:
NOTE:
The preceding three values indicate private read and write, public read, and public read and write. |
sc |
Optional (additional parameter) |
Indicates the storage classes of objects that can be specified when uploading files. Possible values are:
|
meta |
Optional (additional parameter) |
Indicates the customized metadata that can be specified when uploading files. The format is key1:value1#key2:value2#key3:value3.
NOTE:
The preceding value indicates that the object in the bucket contains three groups of customized metadata after the file is uploaded: key1:value1, key2:value2, and key3:value3. |
ps |
Optional (additional parameter) |
Indicates the size of each part in a multipart upload task, in bytes. The value ranges from 100KB to 5GB. The default value is the value of defaultPartSize in the configuration file.
NOTE:
|
cpd |
Optional (additional parameter) |
Indicates the folder where the part records reside. The default value is .obsutil_checkpoint, the subfolder in the home directory of the user who executes obsutil commands.
NOTE:
A part record is generated during a multipart upload and saved to the upload subfolder. After the upload succeeds, its part record is deleted automatically. If the upload fails or is suspended, the system attempts to resume the task according to its part record when you perform the upload the next time. |
f |
Optional (additional parameter) |
Runs in force mode. |
j |
Optional (additional parameter) |
Maximum number of concurrent tasks for uploading a folder. The default value is the value of defaultJobs in the configuration file.
NOTE:
The value is ensured to be greater than or equal to 1. |
exclude |
Optional (additional parameter) |
Indicates the file matching patterns that are excluded, for example: *.txt.
NOTE:
NOTICE:
|
include |
Optional (additional parameter) |
Indicates the file matching patterns that are included, for example: *.jpg.
NOTE:
NOTICE:
|
at |
Optional (additional parameter) |
Indicates that when resuming a failed upload task, only the files whose latest access time is within the value of timeRange are uploaded.
NOTE:
|
timeRange |
Optional (additional parameter) |
Indicates the time range matching pattern when uploading files. Only files whose latest modification time is within the configured time range are uploaded. This pattern has a lower priority than the file matching patterns (exclude/include). That is, the time range matching pattern is executed after the configured file matching patterns.
NOTE:
NOTICE:
Time in the matching pattern is the UTC time. |
mf |
Optional (additional parameter) |
Indicates that the name matching pattern (include or exclude) and the time matching pattern (timeRange) also take effect on objects whose names end with a slash (/). |
o |
Optional (additional parameter) |
Indicates the folder where operation result lists reside. After the command is executed, result lists (possibly including success, failure, and warning files) are generated in the folder. The default value is .obsutil_output, the subfolder in the home directory of the user who executes obsutil commands.
NOTE:
|
clear |
Optional (additional parameter) |
Deletes the failure result files after the upload task is resumed. |
config |
Optional (additional parameter) |
User-defined configuration file for executing a command. For details about parameters that can be configured, see Parameter Description. |
e |
Optional (additional parameter) |
Specifies the endpoint. |
i |
Optional (additional parameter) |
Specifies the user's AK. |
k |
Optional (additional parameter) |
Specifies the user's SK. |
t |
Optional (additional parameter) |
Specifies the user's security token. |
Response
Refer to Response for uploading an object.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.