No part of this document may be reproduced or transmitted in any form or by any means without prior
written consent of Huawei Technologies Co., Ltd.
Trademarks and Permissions
and other Huawei trademarks are trademarks of Huawei Technologies Co., Ltd.
All other trademarks and trade names mentioned in this document are the property of their respective
holders.
Notice
The purchased products, services and features are stipulated by the contract made between Huawei and
the customer. All or part of the products, services and features described in this document may not be
within the purchase scope or the usage scope. Unless otherwise specied in the contract, all statements,
information, and recommendations in this document are provided "AS IS" without warranties, guarantees
or representations of any kind, either express or implied.
The information in this document is subject to change without notice. Every eort has been made in the
preparation of this document to ensure accuracy of the contents, but all statements, information, and
recommendations in this document do not constitute a warranty of any kind, express or implied.
3.1 Preparing the Environment..................................................................................................................................................6
4.1 Creating a Bucket..................................................................................................................................................................12
4.5 Deleting a Bucket..................................................................................................................................................................21
4.6 Conguring a Bucket Policy.............................................................................................................................................. 22
4.7 Obtaining a Bucket Policy..................................................................................................................................................23
4.8 Deleting a Bucket Policy.....................................................................................................................................................24
5.1 Creating a Folder...................................................................................................................................................................26
5.2 Uploading an Object............................................................................................................................................................28
5.6 Copying an Object................................................................................................................................................................ 49
5.7 Moving an Object................................................................................................................................................................. 59
5.8 Downloading an Object......................................................................................................................................................68
5.9 Generating the Download Link of an Object..............................................................................................................79
5.10 Deleting an Object............................................................................................................................................................. 83
5.19 Deleting a Multipart Upload Task..............................................................................................................................141
5.20 Creating an Authorization Code for Directory Sharing.......................................................................................144
5.21 Listing Objects by Using an Authorization Code.................................................................................................. 146
5.22 Downloading Objects by Using an Authorization Code..................................................................................... 149
6.2 Deleting Part Records....................................................................................................................................................... 160
6.3 Viewing Command Help Information......................................................................................................................... 162
6.4 Querying the Version Number.......................................................................................................................................164
6.6 Checking and Updating the Version............................................................................................................................ 166
6.7 Listing Failure Result Files............................................................................................................................................... 167
7.9 Deleting All Multipart Upload Tasks in a Bucket.................................................................................................... 177
8.3 Result Lists............................................................................................................................................................................ 179
9.6 Using obsutil for Resumable Data Transfer...............................................................................................................189
9.7 Using obsutil to Upload a Symbolic Link................................................................................................................... 190
Conguring an HTTP Proxy for obsutil.......................................................................................................................190
9.8
9.9 Using obsutil to Share Directories................................................................................................................................ 191
9.10 Using obsutil to Replicate Data Across Regions on the Client Side............................................................... 192
A Parameter Description.......................................................................................................193
Object Storage Service
Tool Guide (obsutil)1 Introduction to obsutil
1 Introduction to obsutil
obsutil is a command line tool for accessing and managing OBS on HUAWEI
CLOUD. You can use this tool to perform common
creating buckets, uploading and downloading les/folders, and deleting les/folders. If you are familiar with command line interface (CLI), obsutil is
recommended for batch processing and automated tasks.
congurations on OBS, such as
obsutil is compatible with the Windows, Linux, and macOS operating systems
(OSs). Table 1-1 lists the recommended OS versions. To obtain the obsutil
download links and methods for
Table 1-1 Recommended OS versions for using obsutil
OS
Windows● Windows 7
Linux● SUSE 11
macOSmacOS 10.13.4
Tool Advantages
dierent OSs, refer to Downloading obsutil.
Recommended Version
● Windows 8
● Windows 10
● Windows Server 2016
● EulerOS 2
● CentOS 7
obsutil features the following advantages:
1.Simple and easy to use
2.Lightweight and installation-free
3.Compatible with Windows, Linux, and macOS operating systems
Diversiedcongurations and excellent performance
Object Storage Service
Tool Guide (obsutil)1 Introduction to obsutil
Application Scenarios
●Automated backup and archiving, for example, periodically uploading local
data to OBS.
●Scenarios that cannot be implemented using other tools such as OBS Browser
+, for example, synchronously uploading, downloading, and copying objects.
Functions
Table 1-2 lists obsutil functions.
Table 1-2 obsutil functions
FunctionDescription
Basic operations on
buckets
Basic operations on
objects
LoggingAllows you to congure logging on the client side to
Create buckets of dierent storage classes in specic
regions, delete buckets, and obtain the bucket list and
conguration information.
Manage objects, including uploading, downloading,
deleting, and listing objects. Supported operations are
detailed as follows:
● Upload one or more les or folders.
● Upload large les in multiple parts.
● Synchronously upload, download, and copy
incremental objects.
● Copy a single object or copy multiple objects in
batches by object name
● Move a single object or move objects in batches by
object name
● Resume failed upload, download, or copy tasks.
record operations on buckets and objects for statistics
analysis later.
prex.
prex.
Advanced bucket and object management operations are being developed
continuously, and will be available in later versions of obsutil. You can also go to
OBS Console and explore more. For details, see OBS Console Operation Guide.
Command Line Structure
The obsutil command line structures are as follows:
Object Storage Service
Tool Guide (obsutil)1 Introduction to obsutil
● command indicates the command to be executed, for example, ls or cp.
● parameters indicates the basic parameters (mandatory) of the command, for example,
bucket name when creating a bucket.
● options indicates the additional parameters (optional) of the command. Additional
parameters must be preceded with a hyphen (-) when you run the command.
● The square brackets ([]) are not part of the command. Do not enclose parameter values
with them when entering a command.
● If the command contains special characters including ampersands (&), angle brackets
(<) and (>), and spaces, they need to be escaped using quotation marks. Use single
quotation marks for Linux or macOS and quotation marks for Windows.
● Additional parameters can be input in the -
-acl=private, or -acl private. There is no dierence between the two formats. Select
either one as you like.
● In Windows, you can directly execute obsutil.exe to enter an interactive command
mode. In this mode, you can input
command [parameters...] [options...]
to run a command. An example is provided as follows:
Enter "exit" or "quit" to logout
Enter "help" or "help command" to show help docs
Input your command:
-->ls -limit=3 -s
obs://bucket-001
obs://bucket-002
obs://bucket-003
Bucket number is: 3
key=value
or -
key value
format, for example,
without obsutil
Input your command:
-->
● If you use SSH to remotely log in to the Linux or macOS for running obsutil commands,
you are advised to set TMOUT=0 to prevent the program from exiting due to the
expiration of the SSH session.
Object Storage Service
Tool Guide (obsutil)2 Download and Installation
2 Download and Installation
Download Links
Table 2-1 lists the download links of obsutil for
Table 2-1 Download links of obsutil
Operatin
g System
Windows
(64-bit)
Linux
AMD
(64-bit)
Linux
ARM
(64-bit)
macOS
(64-bit)
Download LinkHow to UseView Help
obsutil_windows64
obsutil_windows64_sha256
obsutil_linux_amd64
obsutil_linux_amd64_sha256
obsutil_linux_arm64
obsutil_linux_arm64_sha256
obsutil_mac64
obsutil_mac64_sha256
dierent operating systems.
After the download
is complete, click
here to see how to
quickly get started
with obsutil.
Basic functions
● Listing Buckets
● Uploading an
Object
● Listing Objects
You can also
click here to
learn how
to use the
help
command
to get
familiar
with more
functions of
obsutil.
For details about the version revision records of obsutil, see ChangeLog.
Quick Installation
Methods of downloading obsutil vary according to dierent operating systems.
obsutil is an installation-free tool and can be used after the package is
downloaded and decompressed.
●In Windows
a.Directly download the obsutil package to your local PC using the
Object Storage Service
Tool Guide (obsutil)2 Download and Installation
b.After the download completes, decompress the package to a specied
folder.
c.Double-click obsutil.exe in the decompressed folder and then you can
use the tool.
Alternatively, you can open the CLI to go to the upper-level directory of
obsutil.exe and run obsutil commands. The command line structures of the two
modes are dierent. For details, see Command Line Structure.
●In Linux
a.Open the CLI and run the wget command to download the obsutil tool
You can also download the obsutil package from a PC running the Windows
operating system and then use a cross-platform transfer tool (such as WinSCP) to
transfer the package to your host running the Linux operating system.
b.Run the following command in the directory where the tool package
resides:
tar -xzvf obsutil_linux_amd64.tar.gz
c.Go to the directory where obsutil resides and run the following command
to grant the execute permission to obsutil:
chmod 755 obsutil
●macOS
a.Directly download the obsutil package to your local PC using the
corresponding download link.
b.After the download completes, decompress the package to a
specied
folder.
c.Open the CLI, go to the directory where obsutil resides, and run the
following command to grant the execute permission to obsutil:
chmod 755 obsutil
If you need to use obsutil on a HUAWEI CLOUD ECS, see the reference section below to
congure access to OBS over intranet to save trac costs.
● Accessing OBS over Intranet by Using obsutil on a Linux ECS
Object Storage Service
Tool Guide (obsutil)3 Getting Started
3 Getting Started
3.1 Preparing the Environment
To use obsutil, you need to register a cloud service account, enable OBS, and
obtain the access keys (AK and SK)
rst.
Step 1 Register a cloud service account.
Before using OBS, ensure that you have a cloud service account.
1.Open a browser.
2.Log in to the HUAWEI CLOUD website at huaweicloud.com/intl/en-us/.
3.In the upper right corner of the page, click Register.
4.Enter the registration information and click Register.
Step 2 Enable OBS.
Ensure that your account balance is
1.Log in to OBS Console.
2.Click Fees in the upper right corner of the page. The Billing Center page is
displayed.
3.Then click Top Up.
4.Top up the account as prompted.
5.Go back to the management console page after the recharging is successful.
6.Click Service List on the top menu bar. Choose Storage > Object Storage
Service to log in to OBS Console.
Step 3 (Optional) Create an IAM user.
sucient before using OBS.
For data security, it is recommended that you do not use the account directly to
access OBS. Through the Identity and Access Management (IAM) service, you can
create a user who has the permission to access OBS resources and manage
buckets and objects on obsutil. If you do not need to use any IAM user, skip this
step.
1.On the top navigation bar of the console, choose Service List > Management& Deployment > Identity and Access Management.
Object Storage Service
Tool Guide (obsutil)3 Getting Started
2.On the displayed IAM console page, create a user group with OBS permissions
congured.
For details, see Creating a User Group. After the user group is created, locate
the row that displays Global service > OBS in the User Group Permissions,
and click Congure Policy in the row to set OBS permissions for the user
group.
For details about OBS policies, see Permissions Management
3.Create a user.
For details, see Creating a User. When creating a user, set the User Group to
the one created in Step 3.2 with OBS permissions congured.
If the user group is not congured with OBS permissions, you can congurene-grain
permissions on OBS Console through bucket policies or object policies. For details, see
Permission Control.
Step 4 Obtain access keys.
OBS uses AKs and SKs in user accounts for signature verication to ensure that
only authorized accounts can access
specied OBS resources. Detailed
explanations about AK and SK are as follows:
●Access key ID (AK): indicates the ID of the access key, which is a unique
identier used together with a secret access key to sign requests
cryptographically.
●Secret access key (SK): indicates the private key used together with its
associated AK to cryptographically sign requests. The AK and SK are used
together to identify a request sender to prevent the request from being
modied.
A user can create a maximum of two valid access keys.
Create access keys as follows:
1.In the upper right corner of the console page, select My Credential under the
username.
2.On the My Credentials page, select Access Keys in the navigation pane on
the left.
3.On the Access Keys page, click Add Access Key.
A user can create a maximum of two valid access keys.
4.In the Add Access Key dialog box that is displayed, enter the password and
verication code.
its
– If you have not bound an email address or mobile number, enter only the
password.
– If you have bound an email address and a mobile number, you can select the
Object Storage Service
Tool Guide (obsutil)3 Getting Started
5.Click OK.
6.In the Download Access Key dialog box that is displayed, click OK to save the
access keys to your browser's default download path.
Keep the access keys properly to prevent information leakage. If you click Cancel in
the dialog box, the access keys will not be downloaded, and you cannot download
them later. Re-create access keys if required.
7.Open the downloaded credentials.csvle to obtain the access keys (AK and
SK).
In the access key le, the value in the Access Key ID column is the AK, and the value
in the Secret Access Key column is the SK.
----End
3.2 Performing Initial Conguration
Before using obsutil, you need to congure the interconnection between obsutil
and OBS, including the endpoint and access keys (AK and SK) of OBS. You can use
obsutil to perform operations on OBS buckets and objects only after obtaining the
OBS authentication.
Prerequisites
●You have downloaded the software package of obsutil. For details, see
Download and Installation.
●You have obtained the enabled regions and endpoints of OBS. For details, see
Regions and Endpoints. If you want to access OBS in the AP-Hong Kong
region, the actual OBS service address is: https://obs.apsoutheast-3.myhuaweicloud.com.
●You have obtained the access keys (AK and SK). For details about how to
obtain access keys, see Preparing the Environment. Click here to open the
access key management page.
Conguration Method
Method 1: Run the
cong command, see Updating a Conguration File. The following is an
example:
cong command to initialize obsutil. For details about the
Object Storage Service
Tool Guide (obsutil)3 Getting Started
● After running the preceding commands, a congurationle.obsutilcong is
automatically generated in the same home directory of the user who executes obsutil
commands (the ~ directory in Linux or macOS, and the C:\Users\
in Windows).
● For details about the parameters in the .obsutilcongle, see Parameter Description.
● The .obsutilcongle contains the AK and SK information of a user. Therefore, it is
hidden by default to prevent key disclosure. To query the le, run the following
command in the home directory of the user who executes obsutil commands.
●In Windows
dir
●In Linux or macOS
ls -a
or
ls -al
● obsutil encrypts the AK and SK in the
● Note: You can use the -i, -k, and -e options to
authentication. You can run the history command in the Linux OS to query the
parameter values. Exercise caution when performing this operation.
.obsutilcong contains all the conguration information of obsutil.
.obsutilcong le to ensure key security.
congure user information for
<Username>
directory
Method 2: You can use Conguring Auto Obtaining of Access Keys for obsutil
to implement initial
Checking the Connectivity
After the
the following commands:
●In Windows
●In Linux or macOS
Check the conguration result based on the command output:
●If the command output contains Bucket number is:, the conguration is
●If the command output contains Http status [403], the access keys are
●If the command output contains A connection attempt failed, then OBS
conguration is complete, you can check whether it is correct by running
obsutil ls -s
./obsutil ls -s
correct.
incorrectly congured.
cannot be accessed. In this case, check the network condition.
conguration.
If the command output contains Http status [403], you may not have the required
permissions for obtaining the bucket list. In this case, further locate the root cause based on
the specic situation.
3.3 Quick Start
This section uses the Linux OS as an example to describe how to use obsutil to
perform basic data operations in OBS. For details, see Figure 3-1.
In the preceding command, parameter location indicates the region where a bucket is
created. It is mandatory only when the endpoint set during initial conguration belongs to
any other regions than the default one CN North-Beijing1 (cn-north-1). Click here to query
currently valid regions.
Object Storage Service
Tool Guide (obsutil)4 Bucket Commands
4 Bucket Commands
4.1 Creating a Bucket
Function
You can use this command to create a bucket. A bucket name must be unique in
OBS. One account can create a maximum of 100 buckets.
If you create a bucket and name it the same as an existing one in the same account and
region, no error will be reported and status code 200 is returned. The bucket properties
comply with those set in the rst creation request. In other cases, creating a bucket with
the same name as an existing one will receive the status code 409, indicating that the
bucket already exists.
If the congured endpoint is a global domain name, you may need to wait several
minutes before uploading objects to the created bucket. Therefore, set the
endpoint to a regional domain name according to Performing Initial
Conguration if you want to upload objects instantly to the bucket.
Object Storage Service
Tool Guide (obsutil)4 Bucket Commands
obsutil mb obs://bucket-test
Create bucket [bucket-test] successfully, request id [0000016979E1D2EA860BB5E80A6B8FCC]
●Take the Windows OS as an example. Run the obsutil mb obs://bucket001
command to create a namesake bucket. The creation fails.
obsutil mb obs://bucket001
Create bucket [bucket001] failed, http status [409], error code [BucketAlreadyExists], error message
[The requested bucket name is not available. The bucket namespace is shared by all users of the
system. Please select a
[04030000016757F31A0333281A6B1E92]
dierent name andtry again.], request id
Parameter Description
Parame
ter
Optional or
Mandatory
Description
bucketMandatoryBucket name
NOTE
A bucket name must comply with the following rules:
● Contains 3 to 63 characters, including lowercase
letters, digits, hyphens (-), and periods (.), and starts
with a digit or letter.
● Cannot be an IP address.
● Cannot start or end with a hyphen (-) or period (.).
● Cannot contain two consecutive periods (.), for
example, my..bucket.
● Cannot contain periods (.) and hyphens (-) adjacent
to each other, for example, my-.bucket or my.-bucket.
aclOptional
(additional
parameter)
Access control policies that can be specied when
creating a bucket. Possible values are:
● private
● public-read
● public-read-write
NOTE
The preceding three values indicate private read and
write, public read, and public read and write.
scOptional
(additional
parameter)
Default bucket storage class that can be specied
when creating a bucket. Possible values are:
● standard: OBS Standard, which features low
access latency and high throughput, and is
applicable to storing frequently accessed data
(multiple accesses per month) or data that is
smaller than 1 MB
● warm: OBS Infrequent Access. It is applicable to
storing infrequently accessed (less than 12 times
a year) data that requires quick response.
● cold: OBS Archive. It is secure, durable, and
inexpensive, and applicable to archiving rarelyaccessed (once a year) data.
Object Storage Service
Tool Guide (obsutil)4 Bucket Commands
Parame
ter
Optional or
Mandatory
locationMandatory
unless the
region where
the OBS service
resides is not
the default
region
(additional
parameter)
congOptional
(additional
parameter)
eOptional
(additional
parameter)
iOptional
(additional
parameter)
Description
Region where the bucket resides.
NOTE
This parameter indicates the region where a bucket will
be created. It is mandatory only when the endpoint
belongs to any other regions than the default one CN
North-Beijing1 (cn-north-1). Click here to query currently
valid regions.
User-denedcongurationle for executing a
command. For details about parameters that can
be congured, see Parameter Description.
Species the endpoint.
Species the user's AK.
kOptional
(additional
parameter)
tOptional
(additional
parameter)
4.2 Listing Buckets
Function
You can use this command to obtain the bucket list. In the list, bucket names are
displayed in lexicographical order.
Object Storage Service
Tool Guide (obsutil)4 Bucket Commands
Bucket CreationDate Location BucketType
obs://bucket001 2018-09-03T01:53:02Z example OBJECT
obs://bucket002 2018-11-01T01:40:01Z example OBJECT
obs://bucket003 2018-10-25T11:45:45Z example OBJECT
obs://bucket004 2018-10-26T02:33:09Z example OBJECT
obs://bucket005 2018-10-26T02:34:50Z example OBJECT
Bucket number is: 5
Parameter Description
ParameterOptional or MandatoryDescription
sOptional (additional
parameter)
scOptional (additional
parameter)
jOptional (additional
parameter). It must be
used together with sc.
limitOptional (additional
parameter)
congOptional (additional
parameter)
Displays simplied query result.
NOTE
In the simplied format, the returned
result contains only the bucket name.
Queries the storage classes of the
buckets when listing buckets.
Indicates the maximum number of
concurrent tasks for querying the
bucket storage class. The default
value is the value of defaultJobs in
the congurationle.
NOTE
The value is ensured to be greater than or
equal to 1.
Maximum number of buckets that
can be queried. If the value is less
than 0, all buckets are listed. If it is
left blank, a maximum of 1000
buckets can be listed by default.
User-denedcongurationle for
executing a command. For details
about parameters that can be
congured, see Parameter
Object Storage Service
Tool Guide (obsutil)4 Bucket Commands
In the bucket listing result, the BucketType eld indicates the bucket type; OBJECT
indicates the bucket for object storage.
4.3 Querying Bucket Properties
Function
You can use this command to query the basic properties of a bucket, including its
default storage class, region, version ID, storage usage, bucket quota, and the
number of objects in the bucket.
Command Line Structure
●In Windows
obsutil stat obs://bucket [-acl] [-bf=xxx] [-cong=xxx] [-e=xxx] [-i=xxx] [-k=xxx] [-t=xxx]
●In Linux or macOS
./obsutil stat obs://bucket [-acl] [-bf=xxx] [-cong=xxx] [-e=xxx] [-i=xxx] [-k=xxx] [-t=xxx]
Examples
●Take the Windows OS as an example. Run the obsutil stat obs://bucket-test
command to query the basic properties of bucket bucket-test.
obsutil stat obs://bucket-test
Bucket:
obs://bucket-test
StorageClass:
standard
ObsVersion:
3.0
ObjectNumber:
8005
Size:
320076506
Quota:
0
Parameter Description
Parameter
bucketMandatoryBucket name
aclOptionalQueries the access control policies of the
Object Storage Service
Tool Guide (obsutil)4 Bucket Commands
ParameterOptional or
Mandatory
bfOptional
(additional
parameter)
congOptional
(additional
parameter)
eOptional
(additional
parameter)
iOptional
(additional
parameter)
Description
Display format of the used bucket capacity
(in bytes) Value options:
● human-readable
● raw
NOTE
If this parameter is not congured, the display
format of the used bucket capacity (in bytes) is
determined by the humanReadableFormat
parameter in the
conguration le.
User-dened conguration le for executing
a command. For details about parameters
that can be congured, see Parameter
Description.
Species the endpoint.
Species the user's AK.
Response
kOptional
Species the user's SK.
(additional
parameter)
tOptional
Species the user's security token.
(additional
parameter)
payerOptional
(additional
Species that requester-pays is enabled on a
bucket.
parameter)
Field
Description
BucketBucket name
StorageClassDefault storage class of the bucket
LocationRegion where the bucket resides
ObsVersionVersion of the bucket
BucketTypeType of a bucket. OBJECT indicates a bucket for object
Object Storage Service
Tool Guide (obsutil)4 Bucket Commands
ParameterOptional or
Mandatory
scOptional
(additional
parameter)
aclOptional
(additional
parameter)
Description
Default storage class of the bucket. Possible
values are:
● standard: OBS Standard, which features
low access latency and high throughput,
and is applicable to storing frequently
accessed data (multiple accesses per
month) or data that is smaller than 1
MB
● warm: OBS Infrequent Access. It is
applicable to storing infrequently
accessed (less than 12 times a year) data
that requires quick response.
● cold: OBS Archive. It is secure, durable,
and inexpensive, and applicable to
archiving rarely-accessed (once a year)
data.
Access control policies that can be specied
for buckets. Possible values are:
● private
● public-read
● public-read-write
NOTE
The preceding three values indicate private read
and write, public read, and public read and write.
● In AccessControlList, the Grant
the authorized users. Grantee
IDs of authorized users. Cannedspecies the
authorized user group (currently, only
Everyone is supported).
● The following permissions can be granted:
WRITE (write), WRITE_ACP (write ACL), READ
(read), READ_ACP (read ACL), and
FULL_CONTROL (full control).
Because angle brackets (<) and (>) are
unavoidably included in the parameter value, you
must use quotation marks to enclose them for
escaping when running the command. Use single
quotation marks for Linux or macOS and
quotation marks for Windows.
eld contains
species the
cong
Optional
(additional
parameter)
User-denedcongurationle for executing
a command. For details about parameters
that can be congured, see Parameter
Object Storage Service
Tool Guide (obsutil)4 Bucket Commands
ParameterOptional or
Mandatory
kOptional
(additional
parameter)
tOptional
(additional
parameter)
payerOptional
(additional
parameter)
Only one from sc, acl, or aclXml can be set for each command.
4.5 Deleting a Bucket
Description
Species the user's SK.
Species the user's security token.
Species that requester-pays is enabled on a
bucket.
Function
You can use this command to delete a bucket. The bucket to be deleted must be
empty (containing no objects, historical versions, or fragments).
To delete a non-empty bucket, run the commands in Deleting a Multipart Upload Task
and Deleting an Object to clear the bucket, and then run the following command to
delete the bucket.
Object Storage Service
Tool Guide (obsutil)4 Bucket Commands
Examples
●Take the Windows OS as an example. Run the obsutil bucketpolicy obs://
bucket -method=get -localle=d:\temp\policy.json command to export the
bucket policy to local le policy.json.
Object Storage Service
Tool Guide (obsutil)5 Object Commands
5.2 Uploading an Object
Function
You can use this command to upload one or more local les or folders to a
specied path in OBS. These les can be texts, images, videos, or any other type of
les.
Do not change the local le or folder when uploading it. Otherwise, the upload
may fail or data may be inconsistent.
Restrictions
obsutil has restrictions on the size of les or folders to be uploaded. You can
upload an empty le or folder of 0 bytes. You can also upload a single le or
folder with a maximum size of 5 GB in normal mode or a single le with a
maximum size of 48.8 TB in multipart mode.
●Take the Windows OS as an example. Run the obsutil cp d:\temp\test.txt
obs://bucket-test/key command to upload the test.txt le in the temp
directory in the D: drive to bucket bucket-test and rename the
[========================================================] 100.00% 2.02 KB/s 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 is: 104786c8-27c2-48fc-bc6a-5886596fb0ed
●For more examples, see Upload.
Parameter Description
Parameter
le_urlOptional for
Optional or
Mandatory
uploading
multiple les/
folders
Mandatory for
uploading a
le
Description
Local le path
NOTE
● Do not nest paths when uploading multiple
les/folders. For example, you cannot
specify /a/b/c and /a/b/ at the same time.
● If this parameter is congured when uploading
multiple les/folders,msm must be set to 1. In
this case, use commas (,) to separate multiple
le paths, for example, le_url1,le_url2.
● Files and folders can both be included when
uploading multiple les/folders. For example,
le_url1,folder_url1,le_url2,folder_url2.
Object Storage Service
Tool Guide (obsutil)5 Object Commands
ParameterOptional or
Mandatory
folder_urlOptional for
uploading
multiple les/
folders
Mandatory for
uploading a folder
lelist_urlOptional for
uploading
multiple les/
folders
Description
Local folder path
NOTE
● If at is not congured when uploading a
folder, the entire folder is uploaded. If
congured, all les in the folder are uploaded.
● Do not nest paths when uploading multiple
les/folders. For example, you cannot
specify /a/b/c and /a/b/ at the same time.
● If this parameter is
multiple les/folders,msm must be set to 1. In
this case, use commas (,) to separate multiple
folder paths, for example,
folder_url1,folder_url2.
● Files and folders can be included when
uploading multiple
le_url1,folder_url1,le_url2,folder_url2.
congured when uploading
les/folders. For example,
at is
Indicates the path of the le that contains the
list of les/folders to be uploaded. If this
parameter is congured,msm must be set to
2.
NOTE
● The list
as TXT and CSV. Each line in the le indicates a
le or folder to be uploaded. For example:
le_url1
le_url2
folder_url1
folder_url2
● Do not nest paths in the list
you cannot specify /a/b/c and /a/b/ at the
same time.
Object Storage Service
Tool Guide (obsutil)5 Object Commands
ParameterOptional or
Description
Mandatory
keyOptionalIndicates the object name or object name
prexspecied when uploading a le, or the
object name prexspecied when uploading
a folder.
The rules are as follows:
● If this parameter is left blank when
uploading a
le, the le is uploaded to the
root directory of the bucket and the object
name is the
le name. If the value ends
with a slash (/), the value is used as the
object name
prex when the le is
uploaded, and the object name is the value
plus the le name. If the value does not
end with a slash (/), the
le is uploaded
with the value as the object name.
● If this parameter is left blank when
uploading a folder, the folder is uploaded
to the root directory of the bucket. If the
value ends with a slash (/), the value is
used as the object name
prex of the
folder to be uploaded. If the value does
not end with a slash (/), the folder to be
uploaded is
prexed with the value plus a
slash (/).
NOTE
For details about how to use this parameter, see
Upload.
fr
Optional for
uploading a le
(additional
parameter)
atOptional for
uploading a folder
or multiple les/folders (additional
parameter)
arcDirOptional
(additional
parameter)
dryRunOptional
(additional
parameter)
Generates an operation result list when
uploading a le.
Uploads all les in a folder but not the folder
itself.
Object Storage Service
Tool Guide (obsutil)5 Object Commands
ParameterOptional or
Mandatory
linkOptional
(additional
parameter)
uOptional
(additional
parameter)
Description
Uploads the actual path of the symbolic-link
le/folder
NOTICE
● If this parameter is not specied and the le to
be uploaded is a symbolic-link le whose target
le does not exist, the exception message "The
system cannot
displayed in Windows OS, while the exception
message "No such le or directory" will be
displayed in macOS or Linux OS.
● Avoid the symbolic link loop of a folder,
otherwise, the upload will exit due to panic. If
you do not want the system to panic, set
panicForSymbolicLinkCircle to false in the
conguration le.
nd the le specied" will be
Indicates incremental upload. If this
parameter is set, each le can be uploaded
only when it does not exist in the bucket, its
size is dierent from the namesake one in the
bucket, or it has the latest modication time.
vlengthOptional
(additional
parameter)
vmd5Optional
(additional
parameter)
pOptional
(additional
parameter)
After the upload is complete, check whether
the sizes of the objects in the bucket are the
same as those of the local les.
After the upload completes, check whether
the MD5 values of the objects in the bucket
are the same as those of the local les.
NOTE
● If the size of the le or folder to be uploaded is
too large, using this parameter will degrade the
overall performance due to MD5 calculation.
● After the MD5 value
the parameter value is set to the object
metadata x-obs-md5chksum, which is used for
later MD5 verication during download or copy.
verication is successful,
Indicates the maximum number of concurrent
multipart upload tasks when uploading a le.
The default value is the value of
defaultParallels in the congurationle.
Object Storage Service
Tool Guide (obsutil)5 Object Commands
ParameterOptional or
Mandatory
thresholdOptional
(additional
parameter)
aclOptional
(additional
parameter)
Description
Indicates the threshold for enabling multipart
upload, in bytes. The default value is the
value of defaultBigleThreshold in the
congurationle.
NOTE
● If the size of the
smaller than the threshold, upload it directly.
Otherwise, a multipart upload is required.
● If you upload a le or folder directly, no part
record is generated, and resumable transmission
is not supported.
● This value can contain a capacity unit. For
example, 1 MB indicates 1048576 bytes.
le or folder to be uploaded is
Access control policies that can be specied
when uploading les. Possible values are:
● private
● public-read
● public-read-write
● bucket-owner-full-control
NOTE
The preceding four values indicate private read and
write, public read, public read and write, and
bucket owner full control.
scOptional
(additional
parameter)
metaOptional
(additional
parameter)
Indicates the storage classes of objects that
can be specied when uploading les.
Possible values are:
● standard: OBS Standard, which features
low access latency and high throughput,
and is applicable to storing frequently
accessed data (multiple accesses per
month) or data that is smaller than 1 MB
● warm: OBS Infrequent Access. It is
applicable to storing infrequently accessed
(less than 12 times a year) data that
requires quick response.
● cold: OBS Archive. It is secure, durable, and
inexpensive, and applicable to archiving
rarely-accessed (once a year) data.
Indicates the customized metadata that can
be specied when uploading les. The format
is key1:value1#key2:value2#key3:value3.
NOTE
The preceding value indicates that the objects in
the bucket contain three groups of customized
metadata after the
key2:value2, and key3:value3.
Object Storage Service
Tool Guide (obsutil)5 Object Commands
ParameterOptional or
Mandatory
psOptional
(additional
parameter)
cpdOptional
(additional
parameter)
Description
Indicates the size of each part in a multipart
upload task, in bytes. The value ranges from
100 KB to 5 GB. The default value is the value
of defaultPartSize in the congurationle.
NOTE
● This value can contain a capacity unit. For
example, 1 MB indicates 1048576 bytes.
● The parameter can be set to auto. In this case,
obsutil automatically sets the part size for each
multipart task based on the source
le size.
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.
rMandatory for
uploading a folder
(additional
parameter)
Optional for
uploading
multiple
les/
folders
fOptional for
uploading a folder
or multiple les/folders (additional
parameter)
jOptional for
uploading a folder
or multiple les/folders (additional
parameter)
Indicates les and subfolders within the folder
when uploading a folder recursively.
Runs in force mode.
Indicates the maximum number of concurrent
tasks for uploading a folder. The default value
is the value of defaultJobs in the
congurationle.
NOTE
The value is ensured to be greater than or equal to
uploading a folder
or multiple les/folders (additional
parameter)
Description
Enables the mode for uploading multiple
les/folders. Possible values are 1 and 2.
NOTE
● If msm is set to 1, the source URL indicates a
list of le/folder names separated by commas.
● If msm is set to 2, the source URL indicates a
le containing a list of le/folder names.
● If the le or folder name already contains
commas (,), do not set msm to 1.
● If parameter r is not set, the folders in the list
will not be uploaded.
Indicates the le matching patterns that are
excluded, for example: *.txt.
NOTE
● The asterisk (*) represents any group of
characters, and the question mark (?)
represents any single character. For instance,
abc*.txt indicates any
with abc and ends with .txt.
● You can use \* to represent * and \? to
represent ?.
● If the name of the
the value of this parameter, the le is skipped.
NOTICE
● You are advised to use quotation marks for the
matching pattern to prevent special characters
from being escaped by the OS and leading to
unexpected results. Use single quotation marks
for Linux or macOS and quotation marks for
Windows.
● The matching pattern applies to the absolute
le path (including the le name and le
directory).
● The matching pattern takes
in the folder.
● Multiple exclude parameters can be specied,
for example, -exclude=*.xxx -exclude=*.xxx.
Object Storage Service
Tool Guide (obsutil)5 Object Commands
ParameterOptional or
Mandatory
includeOptional for
uploading a folder
or multiple les/folders (additional
parameter)
Description
Indicates the le matching patterns that are
included, for example: *.jpg.
NOTE
● The asterisk (*) represents any group of
characters, and the question mark (?)
represents any single character.
● You can use \* to represent * and \? to
represent ?.
● Only after identifying that the name of the
to be uploaded does not match the value of
exclude, the system checks whether the
name matches the value of this parameter. If
yes, the le is uploaded. If not, the le is
skipped.
NOTICE
● You are advised to use quotation marks for the
matching pattern to prevent special characters
from being escaped by the OS and leading to
unexpected results. Use single quotation marks
for Linux or macOS and quotation marks for
Windows.
● The matching pattern applies to the absolute
le path (including the le name and le
directory).
● The matching pattern takes eect only for les
in the folder.
● Multiple include parameters can be
for example, -include=*.xxx -include=*.xxx.
le
le
specied,
at
disableDir
Object
Optional for
uploading a folder
or multiple les/folders (additional
parameter)
Optional for
uploading
multiple folders
(additional
parameter)
Indicates that only the les whose latest
access time is within the value of timeRange
are uploaded.
NOTE
● This parameter must be used together with
timeRange.
Indicates the folders themselves are not
uploaded as an object. Conguring this
parameter can avoid uploading empty folders
to a bucket. If a folder contains les, the les
will be uploaded and the original path format
is retained.
Object Storage Service
Tool Guide (obsutil)5 Object Commands
ParameterOptional or
Mandatory
timeRangeOptional for
uploading a folder
or multiple les/folders (additional
parameter)
Description
Indicates the time range matching pattern
when uploading les. Only les whose latest
modication time is within the congured
time range are uploaded.
This pattern has a lower priority than the le
matching patterns (exclude/include). That is,
the time range matching pattern is executed
after the conguredle matching patterns.
NOTE
● The matching time range is represented in
time1-time2
or the same as
yyyyMMddHHmmss
● Automatic formatting is supported. For
example, yyyyMMdd is equivalent to
yyyyMMdd000000, and yyyyMM is equivalent to
yyyyMM01000000.
● If this parameter is set to *-
whose latest modication time is earlier than
time2
les whose latest modication time is later than
time1
NOTICE
Time in the matching pattern is the UTC time.
, where
are matched. If it is set to
are matched.
time1
must be earlier than
time2
. The time format is
.
time2
, all les
time1
-*, all
mf
Optional
(additional
parameter)
Indicates that the name matching pattern
(include or exclude) and the time matching
pattern (timeRange) also take eect on
folders.
Object Storage Service
Tool Guide (obsutil)5 Object Commands
ParameterOptional or
Mandatory
oOptional
(additional
parameter)
Description
Indicates the folder where operation result
lists reside. After the command is executed,
result lists (possibly including success, failure,
and warning les) 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
● The naming rule for result lists is as follows:
cp_{succeed | failed |
time
warning}_report_
● By default, the maximum size of a single result
list is 30 MB and the maximum number of
result lists that can be retained is 1024. You can
set the maximum size and number by
conguring recordMaxLogSize and
recordBackups in the congurationle.
● If there are multiple folders and les and you
need to conrm the detailed error information
about a failed task, refer to the failure list
cp_failed_report_
list folder and the log les in the log path.
_TaskId.txt
time
_TaskId.txt in the result
congOptional
(additional
parameter)
eOptional
(additional
parameter)
iOptional
(additional
parameter)
kOptional
(additional
parameter)
tOptional
(additional
parameter)
payerOptional
(additional
parameter)
User-denedcongurationle for executing a
command. For details about parameters that
can be congured, see Parameter
Object Storage Service
Tool Guide (obsutil)5 Object Commands
Response
FieldDescription
ParallelParameter -p in the request
JobsParameter -j in the request
ThresholdParameter -threshold in the request
PartSizeParameter -ps in the request
ExcludeParameter -exclude in the request
IncludeParameter -include in the request
TimeRangeParameter -timeRange in the request
VerifyLengthParameter -vlength in the request
VerifyMd5Parameter -vmd5 in the request
CheckpointDirParameter -cpd in the request
OutputDirParameter -o in the request
ArcDirParameter -arcDir in the request
Succeed countNumber of successful tasks
Failed countNumber of failed tasks
Skip countNumber of tasks that are skipped during incremental upload,
download, or copy, and synchronous upload, download, or
copy.
NOTE
Skipped tasks are recorded into successful tasks.
Warning countNumber of tasks that are executed successfully but contain
warnings.
NOTE
● The task for which a warning is generated may be a failure or a
success, which needs to be further determined according to the
corresponding result list.
● The number of tasks that generate warnings is independent of the
number of successful or failed tasks. The total number of tasks is
the number of successful tasks plus the number of failed tasks.
Succeed bytesNumber of bytes that are successfully uploaded or
downloaded.
max costMaximum duration of all tasks, in ms
min costMinimum duration of all tasks, in ms
average costAverage duration of all tasks, in ms
average tpsThe average number of tasks completed per second
Object Storage Service
Tool Guide (obsutil)5 Object Commands
ParameterOptional or
Mandatory
bfOptional
(additional
parameter)
congOptional
(additional
parameter)
eOptional
(additional
parameter)
iOptional
(additional
parameter)
Description
Display format of the object size (in bytes)
Value options:
● human-readable
● raw
NOTE
If this parameter is not congured, the display
format of the object size (in bytes) is determined
by the humanReadableFormat parameter in the
conguration le.
User-dened conguration le for
executing a command. For details about
parameters that can be congured, see
Parameter Description.
Species the endpoint.
Species the user's AK.
Response
kOptional
Species the user's SK.
(additional
parameter)
tOptional
Species the user's security token.
(additional
parameter)
payerOptional
(additional
Species that requester-pays is enabled on
a bucket.
parameter)
Field
Description
KeyObject name
LastModiedLatest modication time of the object
SizeObject size, in bytes
StorageClassStorage class of the object
MD5Real MD5 of the object
NOTE
You can query this value only after running the cp command and
Object Storage Service
Tool Guide (obsutil)5 Object Commands
FieldDescription
ETagETag value of an object calculated on the server
ContentTypeContent-Type of the object
MetadataCustomized metadata of the object
AclAccess control policy of the object
5.4 Setting Object Properties
Function
You can use this command to set properties of an object or set properties of
objects in batches by a specied object name prex.
You can set storage classes only for buckets whose version is 3.0.
Command Line Structure
●In Windows
–Setting properties of a single object
Set the acl of object [key] in the bucket [bucket-test] to [public-read] successfully, request id
[04050000016836DDFA73B2B5320E2651]
●Take the Windows OS as an example, run the obsutil chattri obs://bucket-test -r -f -acl=public-read command to set the access permission to all
objects in the bucket to public read.
Object Storage Service
Tool Guide (obsutil)5 Object Commands
Metrics [max cost:177 ms, min cost:53 ms, average cost:102.40 ms, average tps:20.41]
Task id is: 9d7f73-f747-4fdd-9b2a-815ba2dc3b07
Parameter Description
ParameterOptional or
Description
Mandatory
bucketMandatoryBucket name
keyMandatory for
setting properties
of an object.
Optional for
setting properties
of objects in
batches.
scOptional
(additional
parameter)
Indicates the name of the object whose
properties are to be set, or the name prex of
objects whose properties are to be set in
batches.
NOTE
If this parameter is left blank during batch
operation, properties of all objects in the bucket are
set.
Storage classes of objects. Possible values are:
● standard: Standard storage class, which
features low access latency and high
throughput, and is applicable to storing
frequently accessed data (multiple accesses
per month) or data that is smaller than 1
MB
● warm: Infrequent Access or Warm storage
class. It is applicable to storing infrequently
accessed (less than 12 times a year) data
that requires quick response.
● cold: Archive or Cold storage class. It is
secure, durable, and inexpensive, and
applicable to archiving rarely-accessed
(once a year) data.
NOTE
For an object whose storage class is cold, restore the
rst and then set its storage class. To restore
object
an object, see Restoring Objects from OBS Archive.
aclOptional
(additional
parameter)
Access control policies that can be specied for
objects. Possible values are:
● private
● public-read
● public-read-write
● bucket-owner-full-control
NOTE
The preceding four values indicate private read and
write, public read, public read and write, and bucket
owner full control.
● In AccessControlList, the Grant
the authorized users. Granteespecies the IDs of
authorized users. Canned
authorized user group (currently, only Everyone
is supported).
● The following permissions can be granted: WRITE
(write), WRITE_ACP (write ACL), READ (read),
READ_ACP (read ACL), and FULL_CONTROL (full
control).
Because angle brackets (<) and (>) are unavoidably
included in the parameter value, you must use
quotation marks to enclose them for escaping when
running the command. Use single quotation marks
for Linux or macOS and quotation marks for
Windows.
eld contains
species the
versionId
Optional for
setting properties
Version ID of the object whose properties are
to be set
of an object
(additional
parameter)
frOptional for
setting properties
Generates an operation result list when setting
properties of an object.
of an object
(additional
parameter)
Object Storage Service
Tool Guide (obsutil)5 Object Commands
ParameterOptional or
Mandatory
fOptional when
setting properties
of objects in
batches
(additional
parameter)
rMandatory when
setting properties
of objects in
batches
(additional
parameter)
vOptional when
setting properties
of objects in
batches
(additional
parameter)
oOptional
(additional
parameter)
Description
Runs in force mode.
Sets properties of objects in batches based on
a specied object name prex.
Sets properties of versions of objects in batches
based on a specied object name prex.
Indicates the folder where operation result lists
reside. After the command is executed, result
lists (including success and failure les) 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
● The naming rule for result lists is as follows:
chattri_{succeed |
time
failed}_report_
By default, the maximum size of a single result
list is 30 MB and the maximum number of result
lists that can be retained is 1024. You can set the
maximum size and number by
recordMaxLogSize and recordBackups in the
congurationle.
● If there are multiple folders and les and you
need to conrm the detailed error information
about a failed task, refer to the failure list
chattri_failed_report_
result list folder and the log les in the log path.
_TaskId.txt
time
_TaskId.txt in the
conguring
jOptional when
setting properties
of objects in
batches
(additional
parameter)
Indicates the maximum number of concurrent
tasks for setting object properties in batches.
The default value is the value of defaultJobs in
the congurationle.
NOTE
The value is ensured to be greater than or equal to
1.
NO TE
Object Storage Service
Tool Guide (obsutil)5 Object Commands
ParameterOptional or
Mandatory
congOptional
(additional
parameter)
eOptional
(additional
parameter)
iOptional
(additional
parameter)
kOptional
(additional
parameter)
tOptional
(additional
parameter)
payerOptional
(additional
parameter)
Description
User-denedcongurationle for executing a
command. For details about parameters that
can be congured, see Parameter Description.
Species the endpoint.
Species the user's AK.
Species the user's SK.
Species the user's security token.
Species that requester-pays is enabled on a
bucket.
Only one from acl, sc, or aclXml can be set for each command.
Response
Refer to Response for uploading an object.
5.5 Listing Objects
Function
You can use this command to query objects or object versions in a bucket. All
objects are listed in lexicographical order by object name and version ID.
Command Line Structure
●In Windows
obsutil ls obs://bucket[/prex] [-s] [-d] [-v] [-marker=xxx] [-versionIdMarker=xxx] [-bf=xxx] [limit=1]
If this parameter is left blank, all objects in the
bucket are listed.
Displays simplied query result.
NOTE
In the simplied format, the returned result
contains only the object name.
Object Storage Service
Tool Guide (obsutil)5 Object Commands
ParameterOptional or
Mandatory
dOptional
(additional
parameter)
vOptional
(additional
parameter)
markerOptional
(additional
parameter)
versionIdMa
rker
Optional
(additional
parameter). It
must be used
together with the v
and marker
parameters.
Description
Lists only objects and subdirectories in the
current directory, instead of recursively
listing all objects and subdirectories.
NOTE
According to the naming conventions in OBS, a
slash (/) is used as the directory separator.
Lists versions of an object in a bucket. The
result contains the latest version and
historical versions (if any) of the object.
Object name to start with when listing
objects in a bucket. All objects are listed in
lexicographical order by object name.
NOTE
For details about how to use this parameter, see
Listing.
Version ID to start with when listing
versions of objects in a bucket. All versions
and objects are listed in lexicographical
order by object name and version ID.
NOTE
If the value of versionIdMarker is not a version
ID
specied by marker, versionIdMarker is
invalid.
bfOptional
(additional
parameter)
limitOptional
(additional
parameter)
Display formats of bytes in the listing
result. Possible values are:
● human-readable
● raw
NOTE
If this parameter is not congured, the display
format of bytes in the result is determined by
the humanReadableFormat parameter in the
congurationle.
Maximum number of objects that can be
listed. If the value is less than or equal to 0,
all objects are listed. If it is left blank, 1000
objects are listed by default.
NOTE
If there are a large number of objects in a
bucket, you are advised to set this parameter to
limit the number of objects to be listed each
time. If not all objects are listed, marker and
versionIdMarker of the next request will be
returned in the result, which you can use to list
the remaining objects.
● The source path and destination path cannot be the same.
● The source path and destination path cannot be partly overlapped either. If the source
path overlaps with the prex of the destination path, recursive replication applies. If the
destination path overlaps with the prex of the source path, the replication may
overwrite objects in the source path.
●Take the Windows OS as an example. Run the obsutil cp obs://bucket-
test/key obs://bucket-test2 command to copy a single object.
[=============================================================] 100.00% 10/s 0s
Succeed count is: 5 Failed count is: 0
Metrics [max cost:298 ms, min cost:192 ms, average cost:238.00 ms, average tps:9.71]
Task id is: 0476929d-9d23-4dc5-b2f8-0a0493f027c5
Object Storage Service
Tool Guide (obsutil)5 Object Commands
●For more examples, see Copy.
Parameter Description
ParameterOptional or
Description
Mandatory
srcbucketMandatorySource bucket name
dstbucketMandatoryDestination bucket name
destOptionalIndicates the destination object name when
copying an object, or the name prex of
destination objects when copying objects in
batches.
keyMandatory
for copying
an object.
Optional for
copying
objects in
batches.
Indicates the source object name when copying an
object, or the name prex of source objects when
copying objects in batches.
The rules are as follows:
● This parameter cannot be left blank when
copying an object. If dest is left blank, the
source object is copied to the root directory of
the destination bucket. If the value of dest
ends with a slash (/), the destination object
name is the value of dest plus the source
object name. Otherwise, the destination object
name is the value of dest.
● If this parameter is left blank when copying
objects in batches, all objects in the source
bucket are copied. If not, objects whose name
prex is the set value in the source bucket are
copied. The rules for
conrming the name of
the destination object are as follows:
– If the value of dest ends with a slash (/),
the destination object name is the value of
dest plus the source object name.
– If the value of dest does not end with a
slash (/), the destination object name is
value of dest/source object name
NOTE
● If this parameter is
parameter is not when copying objects in batches,
the name of the source object contains the name
prex of the parent object. If at is congured, then
the name of the source object does not contain the
prex of the parent object.
name
● For details about how to use this parameter, see
Object Storage Service
Tool Guide (obsutil)5 Object Commands
ParameterOptional or
Mandatory
frOptional for
copying an
object
(additional
parameter)
atOptional for
copying
objects in
batches
(additional
parameter)
dryRunOptional
(additional
parameter)
crrOptional
(additional
parameter)
Description
Generates an operation result list when copying
an object.
The name prex of the parent object is excluded
when copying objects in batches.
Conducts a dry run.
Enables the client-side cross-region replication
function. In this mode, data is directly copied to
the destination bucket from the source bucket
through data stream. The buckets can by any two
OBS buckets.
NOTE
● If this parameter is congured, ensure that the
conguration of client-side cross-region replication isupdated in the conguration le. For details, see
Updating a Conguration File.
● The congurations of the source bucket and
destination bucket are respectively akCrr/skCrr/tokenCrr/endpointCrr and ak/sk/token/endpoint in
the congurationle.
NOTICE
After this function is enabled, both upload and
download bandwidth are occupied.
Veries whether the object size in the destination
bucket is the same as that in the source bucket
after the copy task completes.
NOTE
This parameter must be used together with crr.
Object Storage Service
Tool Guide (obsutil)5 Object Commands
ParameterOptional or
Mandatory
vmd5Optional
(additional
parameter)
uOptional
(additional
parameter)
pOptional
(additional
parameter)
Description
Veries whether the MD5 value of the destination
bucket is the same as that of the source bucket
after the copy task completes.
NOTE
● This parameter must be used together with crr.
● Objects in the source bucket must contain metadata
x-obs-md5chksum. Otherwise, MD5
be skipped.
After the MD5 value verication is successful, the
parameter value is set to the destination object
metadata x-obs-md5chksum, which is used for later
MD5 verication during download or copy.
verication will
Indicates incremental copy. If this parameter is set,
each object can be copied only when it does not
exist in the destination bucket, its size is dierent
from the namesake one in the destination bucket,
or it has the latest modication time.
Indicates the maximum number of concurrent
multipart copy tasks when copying an object. The
default value is the value of defaultParallels in
the congurationle.
thresholdOptional
(additional
parameter)
versionIdOptional for
copying an
object
(additional
parameter)
Indicates the threshold for enabling multipart
copy, in bytes. The default value is the value of
defaultBigleThreshold in the congurationle.
NOTE
● If the size of the object to be copied is smaller than
the threshold, copy the object directly. If not, a
multipart copy is required.
● If you copy an object directly, no part record is
generated, and resumable transmission is not
supported.
● This value can contain a capacity unit. For example,
1 MB indicates 1048576 bytes.
Source object version ID that can be specied
when copying an object
Object Storage Service
Tool Guide (obsutil)5 Object Commands
ParameterOptional or
Mandatory
aclOptional
(additional
parameter)
scOptional
(additional
parameter)
Description
Access control policies for destination objects that
can be specied when copying objects. Possible
values are:
● private
● public-read
● public-read-write
● bucket-owner-full-control
NOTE
The preceding four values indicate private read and
write, public read, public read and write, and bucket
owner full control.
Storage classes of the destination objects that can
be specied when copying objects. Possible values
are:
● standard: OBS Standard, which features low
access latency and high throughput, and is
applicable to storing frequently accessed data
(multiple accesses per month) or data that is
smaller than 1 MB
● warm: OBS Infrequent Access. It is applicable
to storing infrequently accessed (less than 12
times a year) data that requires quick response.
● cold: OBS Archive. It is secure, durable, and
inexpensive, and applicable to archiving rarelyaccessed (once a year) data.
metaOptional
(additional
parameter)
psOptional
(additional
parameter)
Metadata of destination objects that can be
specied when copying objects. The format is
key1:value1#key2:value2#key3:value3
NOTE
The preceding value indicates that the destination
objects in the bucket contain three groups of customized
metadata after objects are copied: key1:value1,
key2:value2, and key3:value3.
.
Indicates the size of each part in a multipart copy
task, in bytes. The value ranges from 100 KB to 5
GB. The default value is the value of
defaultPartSize in the congurationle.
NOTE
● This value can contain a capacity unit. For example,
1 MB indicates 1048576 bytes.
● The parameter can be set to auto. In this case,
obsutil automatically sets the part size for each
multipart task based on the source object size.
Object Storage Service
Tool Guide (obsutil)5 Object Commands
ParameterOptional or
Mandatory
cpdOptional
(additional
parameter)
rMandatory
for copying
objects in
batches
(additional
parameter)
fOptional for
copying
objects in
batches
(additional
parameter)
Description
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 copy and
saved to the copy subfolder. After the copy succeeds, its
part record is deleted automatically. If the copy fails or is
suspended, the system attempts to resume the task
according to its part record when you perform the copy
the next time.
Copies objects in batches based on a specied
name prex of objects in the source bucket.
Runs in force mode.
jOptional for
copying
objects in
batches
(additional
parameter)
Indicates the maximum number of concurrent
tasks for copying objects in batches. The default
value is the value of defaultJobs in the
congurationle.
NOTE
The value is ensured to be greater than or equal to 1.
Object Storage Service
Tool Guide (obsutil)5 Object Commands
ParameterOptional or
Mandatory
excludeOptional for
copying
objects in
batches
(additional
parameter)
Description
Indicates the matching patterns of source objects
that are excluded, for example: *.txt.
NOTE
● The asterisk (*) represents any group of characters,
and the question mark (?) represents any single
character. For instance, abc*.txt indicates any le
whose name starts with abc and ends with .txt.
● You can use \* to represent * and \? to represent ?.
● If the name of the object to be copied matches the
value of this parameter, the object is skipped.
NOTICE
● You are advised to use quotation marks for the
matching pattern to prevent special characters from
being escaped by the OS and leading to unexpected
results. Use single quotation marks for Linux or
macOS and quotation marks for Windows.
● The matching pattern applies to the absolute path of
an object, including the object name
object name starting from the root directory. For
example, if the path of an object in the bucket is
obs://bucket/src1/src2/test.txt, then the absolute
path of the object is src1/src2/test.txt.
● This matching pattern applies only to objects whose
names do not end with a slash (/).
● Multiple exclude parameters can be
example, -exclude=*.xxx -exclude=*.xxx.
Object Storage Service
Tool Guide (obsutil)5 Object Commands
ParameterOptional or
Mandatory
includeOptional for
copying
objects in
batches
(additional
parameter)
Description
Indicates the matching patterns of source objects
that are included, for example: *.jpg.
NOTE
● The asterisk (*) represents any group of characters,
and the question mark (?) represents any single
character.
● You can use \* to represent * and \? to represent ?.
● Only after identifying that the name of the
copied does not match the value of exclude, the
system checks whether the
value of this parameter. If yes, the
not, the le is skipped.
NOTICE
● You are advised to use quotation marks for the
matching pattern to prevent special characters from
being escaped by the OS and leading to unexpected
results. Use single quotation marks for Linux or
macOS and quotation marks for Windows.
● The matching pattern applies to the absolute path of
an object, including the object name
object name starting from the root directory. For
example, if the path of an object in the bucket is
obs://bucket/src1/src2/test.txt, then the absolute
path of the object is src1/src2/test.txt.
● This matching pattern applies only to objects whose
names do not end with a slash (/).
● Multiple include parameters can be
example, -include=*.xxx -include=*.xxx.
Object Storage Service
Tool Guide (obsutil)5 Object Commands
ParameterOptional or
Mandatory
timeRangeOptional for
copying
objects in
batches
(additional
parameter)
Description
Indicates the time range matching pattern when
copying objects. Only objects whose latest
modication time is within the congured time
range are copied.
This pattern has a lower priority than the object
matching patterns (exclude/include). That is, the
time range matching pattern is executed after the
congured object matching patterns.
NOTE
time1
● The matching time range is represented in
time2
, where
as
time2
● Automatic formatting is supported. For example,
yyyyMMdd is equivalent to yyyyMMdd000000, and
yyyyMM is equivalent to yyyyMM01000000.
● If this parameter is set to *-
latest modication time is earlier than
matched. If it is set to
modication time is later than
NOTICE
● Time in the matching pattern is the UTC time.
● This matching pattern applies only to objects whose
names do not end with a slash (/).
time1
must be earlier than or the same
. The time format is
time1
yyyyMMddHHmmss
time2
, all les whose
time2
-*, all les whose latest
time1
are matched.
-
.
are
mf
Optional
(additional
parameter)
oOptional
(additional
parameter)
Indicates that the name matching pattern
(include or exclude) and the time matching
pattern (timeRange) also take eect on objects
whose names end with a slash (/).
Indicates the folder where operation result lists
reside. After the command is executed, result lists
(possibly including success, failure, and warning
les) 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
● The naming rule for result lists is as follows:
cp_{succeed | failed |
time
warning}_report_
● By default, the maximum size of a single result list is
30 MB and the maximum number of result lists that
can be retained is 1024. You can set the maximum
size and number by
and recordBackups in the congurationle.
● If there are multiple folders and les and you need
[=============================================================] 100.00% 10/s 0s
Succeed count is: 5 Failed count is: 0
Metrics [max cost:298 ms, min cost:192 ms, average cost:238.00 ms, average tps:9.71]
Task id is: 0476929d-9d23-4dc5-b2f8-0a0493f027c5
Object Storage Service
Tool Guide (obsutil)5 Object Commands
Parameter Description
ParameterOptional or
Description
Mandatory
srcbucketMandatorySource bucket name
dstbucketMandatoryDestination bucket name
destOptionalIndicates the destination object name when
moving a single object, or the name prex of
destination objects when moving objects in
batches.
keyMandatory
for moving a
single object
Optional for
moving
objects in
batches
Indicates the source object name when moving a
single object, or the name prex of source objects
when moving objects in batches.
The rules are as follows:
● This parameter cannot be left blank when
moving a single object. If dest is left blank, the
source object is moved to the root directory of
the destination bucket. If the value of dest
ends with a slash (/), the destination object
name is the value of dest plus the source
object name. Otherwise, the destination object
name is the value of dest.
● If this parameter is left blank when moving
objects in batches, all objects in the source
bucket are moved. If not, objects whose name
prex is the set value in the source bucket are
moved. The rules for
conrming the name of
the destination object are as follows:
– If the value of dest ends with a slash (/),
the destination object name is the value of
dest plus the source object name.
– If the value of dest does not end with a
slash (/), the destination object name is
value of dest/source object name
NOTE
● If this parameter is
not when moving objects in batches, the name of the
source object contains the name prex of the parent
object. If at is congured, then the name of the
source object does not contain the name prex of
the parent object.
● For details about how to use this parameter, see
Object Storage Service
Tool Guide (obsutil)5 Object Commands
ParameterOptional or
Mandatory
aclOptional
(additional
parameter)
scOptional
(additional
parameter)
Description
Access control policies for destination objects that
can be specied when moving objects. Possible
values are:
● private
● public-read
● public-read-write
● bucket-owner-full-control
NOTE
The preceding four values indicate private read and
write, public read, public read and write, and bucket
owner full control.
Storage classes of the destination objects that can
be specied when moving objects. Possible values
are:
● standard: OBS Standard, which features low
access latency and high throughput, and is
applicable to storing frequently accessed data
(multiple accesses per month) or data that is
smaller than 1 MB
● warm: OBS Infrequent Access. It is applicable
to storing infrequently accessed (less than 12
times a year) data that requires quick response.
● cold: OBS Archive. It is secure, durable, and
inexpensive, and applicable to archiving rarelyaccessed (once a year) data.
metaOptional
(additional
parameter)
psOptional
(additional
parameter)
Metadata of destination objects that can be
specied when copying objects. The format is
key1:value1#key2:value2#key3:value3
NOTE
The preceding value indicates that the destination
objects in the bucket contain three groups of customized
metadata after objects are copied: key1:value1,
key2:value2, and key3:value3.
.
Indicates the size of each part in a multipart move
task, in bytes. The value ranges from 100 KB to 5
GB. The default value is the value of
defaultPartSize in the congurationle.
NOTE
● This value can contain a capacity unit. For example,
1 MB indicates 1048576 bytes.
● The parameter can be set to auto. In this case,
obsutil automatically sets the part size for each
multipart task based on the source object size.
Object Storage Service
Tool Guide (obsutil)5 Object Commands
ParameterOptional or
Mandatory
cpdOptional
(additional
parameter)
rMandatory
for moving
objects in
batches
(additional
parameter)
fOptional for
moving
objects in
batches
(additional
parameter)
Description
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 move and
saved to the copy subfolder. After the move succeeds, its
part record is deleted automatically. If the move fails or
is suspended, the system attempts to resume the task
according to its part record when you perform the move
the next time.
Moves objects in batches based on a specied
name prex of objects in the source bucket.
Runs in force mode.
jOptional for
moving
objects in
batches
(additional
parameter)
Indicates the maximum number of concurrent
tasks for moving objects in batches. The default
value is the value of defaultJobs in the
congurationle.
NOTE
The value is ensured to be greater than or equal to 1.
Object Storage Service
Tool Guide (obsutil)5 Object Commands
ParameterOptional or
Mandatory
excludeOptional for
moving
objects in
batches
(additional
parameter)
Description
Indicates the matching patterns of source objects
that are excluded, for example: *.txt.
NOTE
● The asterisk (*) represents any group of characters,
and the question mark (?) represents any single
character. For instance, abc*.txt indicates any le
whose name starts with abc and ends with .txt.
● You can use \* to represent * and \? to represent ?.
● If the name of the object to be moved matches the
value of this parameter, the object is skipped.
NOTICE
● You are advised to use quotation marks for the
matching pattern to prevent special characters from
being escaped by the OS and leading to unexpected
results. Use single quotation marks for Linux or
macOS and quotation marks for Windows.
● The matching pattern applies to the absolute path of
an object, including the object name
object name starting from the root directory. For
example, if the path of an object in the bucket is
obs://bucket/src1/src2/test.txt, then the absolute
path of the object is src1/src2/test.txt.
● This matching pattern applies only to objects whose
names do not end with a slash (/).
● Multiple exclude parameters can be
example, -exclude=*.xxx -exclude=*.xxx.
Object Storage Service
Tool Guide (obsutil)5 Object Commands
ParameterOptional or
Mandatory
includeOptional for
moving
objects in
batches
(additional
parameter)
Description
Indicates the matching patterns of source objects
that are included, for example: *.jpg.
NOTE
● The asterisk (*) represents any group of characters,
and the question mark (?) represents any single
character.
● You can use \* to represent * and \? to represent ?.
● Only after identifying that the name of the
moved does not match the value of exclude, the
system checks whether the
value of this parameter. If yes, the
not, the le is skipped.
NOTICE
● You are advised to use quotation marks for the
matching pattern to prevent special characters from
being escaped by the OS and leading to unexpected
results. Use single quotation marks for Linux or
macOS and quotation marks for Windows.
● The matching pattern applies to the absolute path of
an object, including the object name
object name starting from the root directory. For
example, if the path of an object in the bucket is
obs://bucket/src1/src2/test.txt, then the absolute
path of the object is src1/src2/test.txt.
● This matching pattern applies only to objects whose
names do not end with a slash (/).
● Multiple include parameters can be
example, -include=*.xxx -include=*.xxx.
Object Storage Service
Tool Guide (obsutil)5 Object Commands
ParameterOptional or
Mandatory
timeRangeOptional for
moving
objects in
batches
(additional
parameter)
Description
Indicates the time range matching pattern when
moving objects. Only objects whose latest
modication time is within the congured time
range are moved.
This pattern has a lower priority than the object
matching patterns (exclude/include). That is, the
time range matching pattern is executed after the
congured object matching patterns.
NOTE
time1
● The matching time range is represented in
time2
, where
as
time2
● Automatic formatting is supported. For example,
yyyyMMdd is equivalent to yyyyMMdd000000, and
yyyyMM is equivalent to yyyyMM01000000.
● If this parameter is set to *-
latest modication time is earlier than
matched. If it is set to
modication time is later than
NOTICE
● Time in the matching pattern is the UTC time.
● This matching pattern applies only to objects whose
names do not end with a slash (/).
time1
must be earlier than or the same
. The time format is
time1
yyyyMMddHHmmss
time2
, all les whose
time2
-*, all les whose latest
time1
are matched.
-
.
are
mf
Optional
(additional
parameter)
oOptional
(additional
parameter)
Indicates that the name matching pattern
(include or exclude) and the time matching
pattern (timeRange) also take eect on objects
whose names end with a slash (/).
Indicates the folder where operation result lists
reside. After the command is executed, result lists
(possibly including success, failure, and warning
les) 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
● The naming rule for result lists is as follows:
mv_{succeed | failed |
time
warning}_report_
● By default, the maximum size of a single result list is
30 MB and the maximum number of result lists that
can be retained is 1024. You can set the maximum
size and number by
and recordBackups in the congurationle.
● If there are multiple folders and les and you need
Object Storage Service
Tool Guide (obsutil)5 Object Commands
ParameterOptional or
Mandatory
congOptional
(additional
parameter)
eOptional
(additional
parameter)
iOptional
(additional
parameter)
kOptional
(additional
parameter)
tOptional
(additional
parameter)
payerOptional
(additional
parameter)
Description
User-denedcongurationle for executing a
command. For details about parameters that can
be congured, see Parameter Description.
Species the endpoint.
Species the user's AK.
Species the user's SK.
Species the user's security token.
Species that requester-pays is enabled on a
bucket.
Response
Refer to Response for uploading an object.
5.8 Downloading an Object
Function
You can use this command to download an object or download objects in batches
by object name prex to your local PC.
● Do not change the source objects in the OBS bucket when downloading a
single object or objects in batches. Otherwise, the download may fail or data
may be inconsistent.
● If the storage class of the object to be copied is cold, you must restore the
object to be downloaded
[======================================================] 100.00% 155.59 KB/s 0s
Succeed count is: 6 Failed count is: 0
Metrics [max cost:153 ms, min cost:129 ms, average cost:92.00 ms, average tps:17.86]
Task id is: 3066a4b0-4d21-4929-bb84-4829c32cbd0f
Object Storage Service
Tool Guide (obsutil)5 Object Commands
ParameterOptional or
Mandatory
keyMandatory for
downloading an
object
Optional for
downloading
objects in a batch
Description
Indicates the name of the object to be
downloaded, or the name prex of the
objects to be downloaded in batches.
This parameter cannot be left blank when
downloading an object. The saving and
naming rules are as follows:
● If this parameter
species a le or folder
path that does not exist, the tool checks
whether the value ends with a slash (/)
or backslash (\). If yes, a folder is created
based on the path, and the object is
downloaded to this newly created
directory.
● If this parameter
species a le or folder
path that does not exist and the value
does not end with a slash (/) or
backslash (\), the object is downloaded
to your local PC with the value of key as
le name.
the
● If this parameter species an existing le,
the object is downloaded to your local PC
overwriting the existing le, with the
value of key as the
le name.
● If this parameter species an existing
folder, the object is downloaded to the
directory
specied by le_or_folder_url
with the object name as the le name.
The saving rules when downloading objects
in batches are as follows:
● If this parameter is left blank, all objects
in the bucket are downloaded to the
directory
specied by folder_url.
● If this parameter is congured, objects
whose name
prex is the congured
value in the bucket are downloaded to
the directory
NOTE
● If this parameter is congured but the at
parameter is not congured when
downloading objects in a batch, the name of
the downloaded le contains the name prex
of the parent object. If at is congured, then
the name of the downloaded le does not
contain the name prex of the parent object.
● For details about how to use this parameter,
see Download.
Object Storage Service
Tool Guide (obsutil)5 Object Commands
ParameterOptional or
Mandatory
frOptional for
downloading an
object (additional
parameter)
atOptional for
downloading
objects in batches
(additional
parameter)
tempFileDirOptional
(additional
parameter)
Description
Generates an operation result list when
downloading an object.
The name prex of the parent object is
excluded when downloading objects in
batches.
Indicates the directory for storing temporary
les during multipart download. The default
value is the value of defaultTempFileDir in
the congurationle.
NOTE
● If this parameter is left blank and the
defaultTempFileDir parameter in the
conguration le is also left blank, temporary
les generated during multipart download are
saved in the directory where to-bedownloaded
the sux of .obs.temp.
● Temporary les generated during multipart
download are stored in this directory.
Therefore, ensure that the user who executes
obsutil has the write permission on the path.
● The available space of the partition where the
path is located must be greater than the size
of the objects to be downloaded.
Object Storage Service
Tool Guide (obsutil)5 Object Commands
ParameterOptional or
Mandatory
cpdOptional
(additional
parameter)
rMandatory for
downloading
objects in batches
(additional
parameter)
fOptional for
downloading
objects in batches
(additional
parameter)
Description
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
download and saved to the down subfolder. After
the download succeeds, its part record is deleted
automatically. If the download fails or is
suspended, the system attempts to resume the
task according to its part record when you
perform the download the next time.
Copies objects in batches based on a
specied object name prex.
Runs in force mode.
jOptional for
downloading
objects in batches
(additional
parameter)
Indicates the maximum number of
concurrent tasks for downloading objects in
a batch. The default value is the value of
defaultJobs in the congurationle.
NOTE
The value is ensured to be greater than or equal
to 1.
Object Storage Service
Tool Guide (obsutil)5 Object Commands
ParameterOptional or
Mandatory
excludeOptional for
downloading
objects in batches
(additional
parameter)
Description
Indicates the matching patterns of source
objects that are excluded, for example: *.txt.
NOTE
● The asterisk (*) represents any group of
characters, and the question mark (?)
represents any single character. For instance,
abc*.txt indicates any
with abc and ends with .txt.
● You can use \* to represent * and \? to
represent ?.
● If the name of the object to be downloaded
matches the value of this parameter, the
object is skipped.
NOTICE
● You are advised to use quotation marks for
the matching pattern to prevent special
characters from being escaped by the OS and
leading to unexpected results. Use single
quotation marks for Linux or macOS and
quotation marks for Windows.
● The matching pattern applies to the absolute
path of an object, including the object name
prex and object name starting from the root
directory. For example, if the path of an object
in the bucket is obs://bucket/src1/src2/test.txt, then the absolute path of the object
is src1/src2/test.txt.
● This matching pattern applies only to objects
whose names do not end with a slash (/).
● Multiple exclude parameters can be
for example, -exclude=*.xxx -exclude=*.xxx.
Object Storage Service
Tool Guide (obsutil)5 Object Commands
ParameterOptional or
Mandatory
includeOptional for
downloading
objects in batches
(additional
parameter)
Description
Indicates the matching patterns of source
objects that are included, for example: *.jpg.
NOTE
● The asterisk (*) represents any group of
characters, and the question mark (?)
represents any single character.
● You can use \* to represent * and \? to
represent ?.
● Only after identifying that the name of the
le to be downloaded does not match the
value of exclude, the system checks whether
le name matches the value of this
the
parameter. If yes, the le is downloaded. If
not, the le is skipped.
NOTICE
● You are advised to use quotation marks for
the matching pattern to prevent special
characters from being escaped by the OS and
leading to unexpected results. Use single
quotation marks for Linux or macOS and
quotation marks for Windows.
● The matching pattern applies to the absolute
path of an object, including the object name
prex and object name starting from the root
directory. For example, if the path of an object
in the bucket is obs://bucket/src1/src2/test.txt, then the absolute path of the object
is src1/src2/test.txt.
● This matching pattern applies only to objects
whose names do not end with a slash (/).
● Multiple include parameters can be
for example, -include=*.xxx -include=*.xxx.
Object Storage Service
Tool Guide (obsutil)5 Object Commands
ParameterOptional or
Mandatory
timeRangeOptional for
downloading
objects in batches
(additional
parameter)
Description
Indicates the time range matching pattern
when downloading objects. Only objects
whose latest modication time is within the
congured time range are downloaded.
This pattern has a lower priority than the
object matching patterns (exclude/include).
That is, the time range matching pattern is
executed after the
congured object
matching patterns.
NOTE
● The matching time range is represented in
time1-time2
than or the same as
yyyyMMddHHmmss
● Automatic formatting is supported. For
example, yyyyMMdd is equivalent to
yyyyMMdd000000, and yyyyMM is equivalent
to yyyyMM01000000.
● If this parameter is set to *-
whose latest modication time is earlier than
time2
les whose latest modication time is later
than
NOTICE
● Time in the matching pattern is the UTC time.
● This matching pattern applies only to objects
whose names do not end with a slash (/).
, where
are matched. If it is set to
time1
are matched.
time1
must be earlier
time2
. The time format is
.
time2
, all les
time1
-*, all
mf
Optional
(additional
parameter)
Indicates that the name matching pattern
(include or exclude) and the time matching
pattern (timeRange) also take eect on
objects whose names end with a slash (/).
Object Storage Service
Tool Guide (obsutil)5 Object Commands
ParameterOptional or
Mandatory
oOptional
(additional
parameter)
Description
Indicates the folder where operation result
lists reside. After the command is executed,
result lists (possibly including success,
failure, and warning les) 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
● The naming rule for result lists is as follows:
cp_{succeed | failed |
time
warning}_report_
● By default, the maximum size of a single
result list is 30 MB and the maximum number
of result lists that can be retained is 1024. You
can set the maximum size and number by
conguring recordMaxLogSize and
recordBackups in the congurationle.
● If there are multiple folders and les and you
need to conrm the detailed error
information about a failed task, refer to the
failure list cp_failed_report_
in the result list folder and the log les in the
log path.
_TaskId.txt
time
_TaskId.txt
cong
Optional
(additional
parameter)
eOptional
(additional
parameter)
iOptional
(additional
parameter)
kOptional
(additional
parameter)
tOptional
(additional
parameter)
payerOptional
(additional
parameter)
User-denedcongurationle for executing
a command. For details about parameters
that can be congured, see Parameter
Object Storage Service
Tool Guide (obsutil)5 Object Commands
Response
Refer to Response for uploading an object.
5.9 Generating the Download Link of an Object
Function
You can use this command to generate the download link of a specied object in a
bucket or generate the download links of objects in a bucket in batches by object
name
Validity period of the generated download links of
objects, in seconds. Minimum value: 60s. Default
value: 300s
Object Storage Service
Tool Guide (obsutil)5 Object Commands
Parame
ter
Optional or
Mandatory
rMandatory
when
generating
download
links of
objects in
batches
(additional
parameter)
excludeOptional
when
generating
download
links of
objects in
batches
(additional
parameter)
Description
Generates the download links of objects in batches by
a specied object name prex.
Indicates the matching patterns of objects that are
excluded, for example: *.txt.
NOTE
● The asterisk (*) represents any group of characters, and
the question mark (?) represents any single character. For
instance, abc*.txt indicates any le whose name starts
with abc and ends with .txt.
● You can use \* to represent * and \? to represent ?.
● If the name of the object to be downloaded matches the
value of this parameter, the object is skipped.
NOTICE
● You are advised to use quotation marks for the matching
pattern to prevent special characters from being escaped
by the OS and leading to unexpected results. Use single
quotation marks for Linux or macOS and quotation marks
for Windows.
● The matching pattern applies to the absolute path of an
object, including the object name prex and object name
starting from the root directory. For example, if the path
of an object in the bucket is obs://bucket/src1/src2/
test.txt, then the absolute path of the object is src1/src2/
test.txt.
● This matching pattern applies only to objects whose
names do not end with a slash (/).
● Multiple exclude parameters can be
example, -exclude=*.xxx -exclude=*.xxx.
Object Storage Service
Tool Guide (obsutil)5 Object Commands
Parame
ter
Optional or
Mandatory
includeOptional
when
generating
download
links of
objects in
batches
(additional
parameter)
Description
Indicates the matching patterns of objects that are
included, for example: *.jpg.
NOTE
● The asterisk (*) represents any group of characters, and
the question mark (?) represents any single character.
● You can use \* to represent * and \? to represent ?.
● Only after identifying that the name of the
downloaded does not match the value of exclude, the
system checks whether the le name matches the value
of this parameter. If yes, the
le is skipped.
NOTICE
● You are advised to use quotation marks for the matching
pattern to prevent special characters from being escaped
by the OS and leading to unexpected results. Use single
quotation marks for Linux or macOS and quotation marks
for Windows.
● The matching pattern applies to the absolute path of an
object, including the object name
starting from the root directory. For example, if the path
of an object in the bucket is obs://bucket/src1/src2/
test.txt, then the absolute path of the object is src1/src2/
test.txt.
● This matching pattern applies only to objects whose
names do not end with a slash (/).
● Multiple include parameters can be
example, -include=*.xxx -include=*.xxx.
Object Storage Service
Tool Guide (obsutil)5 Object Commands
Parame
ter
Optional or
Mandatory
timeRangeOptional
(additional
parameter)
Description
Indicates the time range matching pattern when
generating download links of objects. Only the
download links of objects whose latest modication
time is within the congured time range are
generated.
This pattern has a lower priority than the object
matching patterns (exclude/include). That is, the time
range matching pattern is executed after the
congured object matching patterns.
NOTE
● Time in the matching pattern is the UTC time.
● This matching pattern applies only to objects whose
names do not end with a slash (/).
● The matching time range is represented in
where
time1
must be earlier than or the same as
The time format is
● Automatic formatting is supported. For example,
yyyyMMdd is equivalent to yyyyMMdd000000, and
yyyyMM is equivalent to yyyyMM01000000.
● If this parameter is set to *-modication time is earlier than
is set to
later than
time1
time1
yyyyMMddHHmmss
time2
, all les whose latest
time2
-*, all les whose latest modication time is
are matched.
time1-time2
.
are matched. If it
time2
,
.
o
Optional
when
generating
download
links of
objects in
batches
(additional
parameter)
congOptional
(additional
parameter)
endpointOptional
(additional
parameter)
iOptional
(additional
parameter)
Indicates the folder where operation result lists reside.
After the command is executed, result lists (possibly
including success and failure les) 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
● The naming rule for result lists is as follows:
sign_{succeed | failed}_report_
By default, the maximum size of a single result list is 30
MB and the maximum number of result lists that can be
retained is 1024. You can set the maximum size and
number by conguringrecordMaxLogSize and
recordBackups in the congurationle.
time
_TaskId.txt
User-denedcongurationle for executing a
command. For details about parameters that can be
congured, see Parameter Description.
Species the endpoint.
Object Storage Service
Tool Guide (obsutil)5 Object Commands
ParameterOptional or
Mandatory
oOptional
(additional
parameter)
Description
Indicates the folder where operation result
lists reside. After the command is executed,
result lists (possibly including success and
failure les) 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
● The naming rule for result lists is as follows:
time
rm_{succeed | failed}_report_
● By default, the maximum size of a single result
list is 30 MB and the maximum number of
result lists that can be retained is 1024. You can
set the maximum size and number by
conguring recordMaxLogSize and
recordBackups in the congurationle.
● If there are multiple folders and les and you
need to
about a failed task, refer to the failure list
rm_failed_report_
list folder and the log les in the log path.
conrm the detailed error information
time
_TaskId.txt in the result
_TaskId.txt
congOptional
(additional
parameter)
eOptional
(additional
parameter)
iOptional
(additional
parameter)
kOptional
(additional
parameter)
tOptional
(additional
parameter)
payerOptional
(additional
parameter)
User-denedcongurationle for executing
a command. For details about parameters
that can be congured, see Parameter
Object Storage Service
Tool Guide (obsutil)5 Object Commands
5.11 Synchronously Uploading Incremental Objects
Function
This function synchronizes all content in the local source path to the specied
target bucket on OBS, ensuring that the content is consistent between the local
path and the target bucket. Incremental synchronization has the following
meanings: 1) Increment: Compare the source le with the target object and
upload only the source
command is executed, ensure that the local source path is a subset of the target
bucket
specied by OBS. That is, any le in the local source path has its
corresponding object in the target bucket on OBS.
● Do not change the local le or folder during synchronization. Otherwise, the
synchronization may fail or data may be inconsistent.
● Each le can be synchronously uploaded only when it does not exist in the
bucket, its size is dierent from the namesake one in the bucket, or it has the
modication time.
latest
le that has changes. 2) Synchronization: After the
[========================================================] 100.00% 2.02 KB/s 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 is: 104786c8-27c2-48fc-bc6a-5886596fb0ed
●For more examples, see Synchronous Upload.
Parameter Description
ParameterOptional or
Description
Mandatory
le_urlMandatory
Local le path
for uploading
a le
synchronousl
y
folder_urlMandatory
Local folder path
for uploading
a folder
synchronousl
y
Object Storage Service
Tool Guide (obsutil)5 Object Commands
ParameterOptional or
Description
Mandatory
keyOptionalIndicates the object name or object name prex
specied when uploading a le synchronously, or
the object name prexspecied when uploading a
folder synchronously.
The rules are as follows:
● If this parameter is left blank when
synchronously uploading a
le, the le is
uploaded to the root directory of the bucket and
the object name is the
le name. If the value
ends with a slash (/), the value is used as the
object name
prex when the le is uploaded,
and the object name is the value plus the le
name. Otherwise, the le is uploaded with the
value as the object name.
● If this parameter is left blank when
synchronously uploading a folder, all objects in
the root directory of the bucket are the same as
les in the local folder. If this parameter is
the
congured, objects whose name prex is the
congured value are the same as the les in the
local folder.
NOTE
● If the value of this parameter does not end with a
slash (/) when synchronously uploading a folder, the
obsutil tool automatically adds a slash (/) at the end
congured value as the object name prex.
of the
● For details about how to use this parameter, see
Synchronous Upload.
fr
Optional for
synchronousl
Generates an operation result list when
synchronously uploading a le.
y uploading a
le
(additional
parameter)
arcDirOptional
(additional
Path to which the synchronously uploaded les are
archived
Object Storage Service
Tool Guide (obsutil)5 Object Commands
ParameterOptional or
Mandatory
linkOptional
(additional
parameter)
vlengthOptional
(additional
parameter)
vmd5Optional
(additional
parameter)
Description
Uploads the actual path of the symbolic-link le/
folder
NOTICE
● If this parameter is not specied and the le to be
uploaded is a symbolic-link le whose target le does
not exist, the exception message "The system cannot
nd the lespecied" will be displayed in Windows
OS, while the exception message "No such le or
directory" will be displayed in macOS or Linux OS.
● Avoid the symbolic link loop of a folder, otherwise, the
upload will exit due to panic. If you do not want the
system to panic, set panicForSymbolicLinkCircle to
false in the
congurationle.
After the synchronous upload is complete, check
whether the sizes of the objects in the bucket are
the same as those of the local les.
After the synchronous upload is complete, check
whether the MD5 values of the objects in the
bucket are the same as those of the local les.
NOTE
● If the size of the le or folder to be uploaded is too
large, using this parameter will degrade the overall
performance due to MD5 calculation.
● After the MD5 value
parameter value is set to the object metadata x-obs-md5chksum, which is used for later MD5 verication
during download or copy.
verication is successful, the
pOptional
(additional
parameter)
thresholdOptional
(additional
parameter)
Indicates the maximum number of concurrent
multipart upload tasks when uploading a le. The
default value is the value of defaultParallels in thecongurationle.
Indicates the threshold for enabling multipart
upload, in bytes. The default value is the value of
defaultBigleThreshold in the congurationle.
NOTE
● If the size of the le or folder to be uploaded is
smaller than the threshold, upload it directly.
Otherwise, a multipart upload is required.
● If you upload a
generated, and resumable transmission is not
supported.
● This value can contain a capacity unit. For example, 1MB indicates 1048576 bytes.
Object Storage Service
Tool Guide (obsutil)5 Object Commands
ParameterOptional or
Mandatory
aclOptional
(additional
parameter)
scOptional
(additional
parameter)
Description
Access control policies that can be specied when
synchronously uploading les. Possible values are:
● private
● public-read
● public-read-write
● bucket-owner-full-control
NOTE
The preceding four values indicate private read and write,
public read, public read and write, and bucket owner full
control.
Indicates the storage classes of objects that can be
specied when synchronously uploading les.
Possible values are:
● standard: OBS Standard, which features low
access latency and high throughput, and is
applicable to storing frequently accessed data
(multiple accesses per month) or data that is
smaller than 1 MB
● warm: OBS Infrequent Access. It is applicable to
storing infrequently accessed (less than 12 times
a year) data that requires quick response.
● cold: OBS Archive. It is secure, durable, and
inexpensive, and applicable to archiving rarelyaccessed (once a year) data.
metaOptional
(additional
parameter)
psOptional
(additional
parameter)
Indicates the customized metadata that can be
specied when uploading les. 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
key3:value3.
le is uploaded: key1:value1, key2:value2, and
Indicates the size of each part in a multipart
upload task, in bytes. The value ranges from 100
KB to 5 GB. The default value is the value of
defaultPartSize in the congurationle.
NOTE
● This value can contain a capacity unit. For example, 1
MB indicates 1048576 bytes.
● The parameter can be set to auto. In this case, obsutil
automatically sets the part size for each multipart
task based on the source
Object Storage Service
Tool Guide (obsutil)5 Object Commands
ParameterOptional or
Mandatory
cpdOptional
(additional
parameter)
jOptional for
synchronousl
y uploading a
folder
(additional
parameter)
excludeOptional for
synchronousl
y uploading a
folder
(additional
parameter)
Description
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.
Indicates the maximum number of concurrent
tasks for uploading a folder synchronously. The
default value is the value of defaultJobs in the
congurationle.
NOTE
The value is ensured to be greater than or equal to 1.
Indicates the le matching patterns that are
excluded, for example: *.txt.
NOTE
● The asterisk (*) represents any group of characters,
and the question mark (?) represents any single
character. For instance, abc*.txt indicates any le
whose name starts with abc and ends with .txt.
● You can use \* to represent * and \? to represent ?.
● If the name of the le to be uploaded matches the
value of this parameter, the
NOTICE
● You are advised to use quotation marks for the
matching pattern to prevent special characters from
being escaped by the OS and leading to unexpected
results. Use single quotation marks for Linux or
macOS and quotation marks for Windows.
● The matching pattern applies to the absolute
(including the le name and le directory).
● The matching pattern takes eect only for les in the
folder.
● Multiple exclude parameters can be specied, for
example, -exclude=*.xxx -exclude=*.xxx.
Object Storage Service
Tool Guide (obsutil)5 Object Commands
ParameterOptional or
Mandatory
includeOptional for
synchronousl
y uploading a
folder
(additional
parameter)
Description
Indicates the le matching patterns that are
included, for example: *.jpg.
NOTE
● The asterisk (*) represents any group of characters,
and the question mark (?) represents any single
character.
● You can use \* to represent * and \? to represent ?.
● Only after identifying that the name of the
uploaded does not match the value of exclude, the
system checks whether the
value of this parameter. If yes, the
not, the le is skipped.
NOTICE
● You are advised to use quotation marks for the
matching pattern to prevent special characters from
being escaped by the OS and leading to unexpected
results. Use single quotation marks for Linux or
macOS and quotation marks for Windows.
● The matching pattern applies to the absolute
(including the le name and le directory).
● The matching pattern takes eect only for les in the
folder.
● Multiple include parameters can be
example, -include=*.xxx -include=*.xxx.
le name matches the
le is uploaded. If
le to be
le path
specied, for
at
disableDir
Object
Optional for
synchronousl
y uploading a
folder
(additional
parameter)
Optional for
synchronousl
y uploading
folders
(additional
parameter)
Indicates that when synchronously uploading a
folder, only the les whose latest access time is
within the value of timeRange are uploaded.
NOTE
● This parameter must be used together with
timeRange.
Indicates the folders themselves are not uploaded
as an object. Conguring this parameter can avoid
uploading empty folders to a bucket. If a folder
contains les, the les will be uploaded and the
original path format is retained.
Object Storage Service
Tool Guide (obsutil)5 Object Commands
ParameterOptional or
Mandatory
timeRangeOptional for
synchronousl
y uploading a
folder
(additional
parameter)
Description
Indicates the time range matching pattern when
synchronously uploading les. Only les whose
latest modication time is within the congured
time range are uploaded.
This pattern has a lower priority than the le
matching patterns (exclude/include). That is, the
time range matching pattern is executed after the
conguredle matching patterns.
NOTE
time1
● The matching time range is represented in
time2
, where
as
time2
● Automatic formatting is supported. For example,
yyyyMMdd is equivalent to yyyyMMdd000000, and
yyyyMM is equivalent to yyyyMM01000000.
● If this parameter is set to *-
latest modication time is earlier than
matched. If it is set to
modication time is later than
NOTICE
Time in the matching pattern is the UTC time.
time1
must be earlier than or the same
. The time format is
time1
yyyyMMddHHmmss
time2
, all les whose
time2
-*, all les whose latest
time1
are matched.
-
.
are
mfOptional
(additional
parameter)
oOptional
(additional
parameter)
Indicates that the name matching pattern (include
or exclude) and the time matching pattern
(timeRange) also take eect on folders.
Indicates the folder where operation result lists
reside. After the command is executed, result lists
(possibly including success, failure, and warning
les) 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
● The naming rule for result lists is as follows:
sync_{succeed | failed |
time
warning}_report_
● By default, the maximum size of a single result list is
30 MB and the maximum number of result lists that
can be retained is 1024. You can set the maximum
size and number by
and recordBackups in the congurationle.
● If there are multiple folders and les and you need to
conrm the detailed error information about a failed
task, refer to the failure list
sync_failed_report_
folder and the log les in the log path.
_TaskId.txt
conguringrecordMaxLogSize
time
_TaskId.txt in the result list
congOptional
(additional
parameter)
User-denedcongurationle for executing a
command. For details about parameters that can
be congured, see Parameter Description.
Object Storage Service
Tool Guide (obsutil)5 Object Commands
Response
ParameterOptional or
Mandatory
eOptional
(additional
parameter)
iOptional
(additional
parameter)
kOptional
(additional
parameter)
tOptional
(additional
parameter)
Refer to Response for uploading an object.
Description
Species the endpoint.
Species the user's AK.
Species the user's SK.
Species the user's security token.
5.12 Synchronously Copying Incremental Objects
Function
This function synchronizes all objects in the
with objects in the specied path in the destination bucket to keep data
consistency. Incremental synchronization has the following meanings: 1)
Increment: Compare the source object with the target object and copy only the
source object that has changes. 2) Synchronization: After the command is
executed, ensure that the
target bucket. That is, any object in the
corresponding object in the target bucket.
● Do not change the source objects in the OBS bucket during synchronization.
Otherwise, the synchronization may fail or data may be inconsistent.
● If the storage class of the object to be copied is cold, you must restore the
object to be copied rst. Otherwise, the copy fails.
● To copy objects, you must have the read permission on the objects to be copied
and the write permission on the destination bucket.
● If the client-side cross-region replication function is not enabled, ensure that
the source bucket and destination bucket are in the same region.
● Each object can be synchronously copied only when it does not exist in the
destination bucket, its size is
destination bucket, or it has the latest modication time.
specied path of the source bucket is a subset of the
[=============================================================] 100.00% 10/s 0s
Succeed count is: 5 Failed count is: 0
Metrics [max cost:298 ms, min cost:192 ms, average cost:238.00 ms, average tps:9.71]
Task id is: 0476929d-9d23-4dc5-b2f8-0a0493f027c5
●For more examples, see Synchronous Copy.
Parameter Description
Parameter
srcbucketMandatorySource bucket name
dstbucketMandatoryDestination bucket name
destOptionalName prex of destination objects.
Optional or
Mandatory
Description
NOTE
If the value of this parameter does not end with a
slash (/), the obsutil tool automatically adds a
slash (/) at the end of the congured value as the
name prex of destination objects.