You can use the -h option to view all options supported by ossutil.

Command syntax

./ossutil -h
To view the options that a command supports, run the ossutil help [command] command such as ossutil help cp.

Common options

The following section describes common options that can be added to most commands supported by ossutil:

  • -c, --config-file

    Specifies the configuration file path of ossutil. ossutil reads the configuration file during the startup, and writes configurations to the file by using the config command. When you manage buckets that belong to different accounts, you can generate multiple configuration files, and set one of these configuration files to the default configuration file. When you manage a bucket that belongs to other accounts, you can use the -c option to specify the corresponding configuration file.

  • -e, --endpoint

    Specifies the endpoint of a bucket. When you manage buckets across regions, you can use the -e option to specify the regions.

  • -i, --access-key-id

    Specifies the AccessKey ID used to access OSS. When you manage buckets that belong to different accounts, you can use the -i option to specify the corresponding AccessKey IDs.

  • -k, --access-key-secret

    Specifies the AccessKey secret used to access OSS. When you manage buckets that belong to different accounts, you can use the -k option to specify the corresponding AccessKey secrets.

  • --loglevel
    Generates the ossutil.log file in the current working folder. The default value is null, which indicates that no log files are generated. Valid values: info and debug.
    • Default: The value of --loglevel is null, which indicates that no log files are generated.
    • info: generates operations logs of ossutil.
      ./ossutil [command] --loglevel=info
    • debug: generates logs that contain HTTP requests and responses and original signature strings to locate problems.
      ./ossutil [command] --loglevel=debug
  • --proxy-host, --proxy-user, and --proxy-pwd

    If your environment requires a proxy server to access websites, you must use these three options to specify the information of the proxy server. ossutil uses the specified information to access OSS through the corresponding proxy server.

    Example:
    ./ossutil ls oss://bucket1 --proxy-host http://47.88. **.**:3128 --proxy-user test --proxy-pwd test

Options

The following table describes all options supported by ossutil.
Option Description
-s, --short-format Displays items in the short format. The long format is used if this option is not specified.
--bigfile-threshold Specifies the size threshold for resumable data transfer. Unit: bytes. Valid values: non-negative integers. Default value: 100 MB.
--acl Configures access control list (ACL) for an object or a bucket.
--range Specifies the byte range of the object to download. Bytes are numbered from 0.
  • You can specify a range. For example, 3-9 indicates a range from byte 3 to byte 9, which includes byte 3 and byte 9.
  • You can specify the field from which the download starts. For example, 3- indicates a range from byte 3 to the end of the object, which includes byte 3.
  • You can specify the field with which the download ends. For example, -9 indicates a range from byte 0 to byte 9, which includes byte 9.
--all-versions Specifies all versions of an object.
--type Specifies the algorithm that is used for calculation. Valid values: crc64 and md5. Default value: crc64.
-v, --version Displays the ossutil version and exits.
-u, --update Updates the ossutil version.
--origin Specifies the value of the Origin header in an HTTP request.
--upmode Specifies the upload mode. Valid values: normal, append, and multipart. Default value: normal. This option can be added to the probe command.
--sse-algorithm Specifies the server-side encryption algorithm. Valid values: KMS and AES256.
--include Includes objects that match a specific string such as *.jpg.
--exclude Excludes objects that match a specific string such as *.txt.
-r, --recursive Performs operations on objects in a bucket. If this option is specified, commands that support this option perform operations on all objects in a bucket that meet the specified conditions. If this option is not specified, the commands perform operations only on the specified object.
--addr Specifies a network address, which is a domain name in most cases. This option can be added to the probe command.
--kms-masterkey-id Specifies the CMK ID used for encryption in Key Management Service (KMS).
--version-id Specifies the version ID of an object.
--version-id-marker Specifies the object version from which you want to start listing.
-m, --multipart Specifies that operations are to be performed only on incomplete multipart upload tasks in a bucket instead of default objects.
-d, --directory Displays objects and subfolders in the current folder, instead of recursively displaying all objects in all subfolders.
--payer Specifies the payer of the request. If pay-by-requester is enabled, you can set this option to requester.
--maxupspeed Specifies the maximum upload speed. Unit: KB/s. Default value: 0. 0 indicates that the maximum upload speed is unlimited.
--retry-times Specifies the number of times an operation is retried if the operation fails. Valid values: 1 to 500. Default value: 10.
-c, --config-file Specifies the configuration file path of ossutil. ossutil reads the configuration file during the startup, and writes configurations to the file by using the config command.
--download Downloads an object from OSS. This option can be added to the probe command.
-j, --jobs Specifies the number of concurrent jobs performed across multiple objects. Valid values: 1 to 10000. Default value: 3.
-a, --all-type Specifies that operations are to be performed on both the objects and incomplete multipart upload tasks in a bucket.
--disable-empty-referer Specifies that the Referer field cannot be empty. This option can be added to the referer command.
--method Specifies the type of HTTP request. Valid values: PUT, GET, and DELETE.
--output-dir Specifies the folder in which output objects are located. Output objects include report objects generated due to errors that occur when you use the cp command to copy multiple objects. For more information about the report objects, see the help information of the cp command. The default value is the ossutil_output folder in the current folder.
--meta Specifies the metadata of an object in the [header:value#header:value...] format. Example: Cache-Control: no-cache#Content-Encoding: gzip.
--object Specifies the name of an object in OSS. This option is used in the probe command.
-e, --endpoint Specifies the endpoint of ossutil. This option value overwrites the corresponding endpoint in the configuration file. For more information about endpoints of different regions, see Regions and endpoints.
--end-time Specifies the timestamp in Linux or Unix. If you enter this option, objects whose last update time is later than the timestamp are ignored.
--limited-num Specifies the maximum number of results to return.
-L, --language Specifies the language that ossutil uses. Valid values: CH and EN. Default value: CH. To set this option to CH, ensure that your system supports UTF-8 encoding.
--delete Specifies a delete operation.
-b, --bucket Specifies the bucket on which to perform an operation.
--disable-crc64 Disables CRC-64. By default, CRC-64 is enabled when you use ossutil for data transfer.
--upload Uploads an object to OSS. This option can be added to the probe command.
--part-size Specifies the part size in bytes. By default, ossutil calculates the appropriate part size based on the object size. You can set this option to any positive integer if you need to optimize performance or special requirements exist.
--timeout Specifies the timeout period of a signed URL request. Unit: seconds. Valid values: non-negative integers. Default value: 60.
-k, --access-key-secret Specifies the AccessKey secret used to access OSS. This option value overwrites the corresponding configurations in the configuration file.
--checkpoint-dir Specifies the checkpoint folder. Default value: .ossutil_checkpoint. If a resumable data transfer task fails, ossutil automatically creates this folder and records the checkpoint information in the folder. If a resumable data transfer task succeeds, ossutil deletes this folder. If this option is specified, ensure that you have permissions to delete the specified folder.
--url Specifies the URL of an object. This option can be added to the probe command.
--marker Specifies the bucket name, object name, or multipart upload ID from which you want to start listing.
-f, --force Forces an operation without prompting the user for confirmation.
--snapshot-path If you specify the --snapshot-path option when you upload or download multiple objects, ossutil takes a snapshot of the upload or download and stores the snapshot information in a specified folder. The next time the objects are uploaded or downloaded while this option is specified, ossutil reads the snapshot information from the specified folder and performs incremental upload or download.
Notice
  • The --snapshot-path option is used to accelerate the incremental upload or download of objects. This option cannot be used to copy objects. This option can be used when the number of objects is large and no other users modify the corresponding objects in OSS between the two uploads.
  • You can use the --snapshot-path option to record the lastModifiedTime of uploaded or downloaded objects on the local computer. OSS compares the last modified time with that of objects currently pending upload or download to determine which objects can be skipped. When you use this option, ensure that the corresponding objects in OSS are not modified between the two uploads or downloads. In other scenarios where objects are updated in OSS between the two uploads or downloads, use the --update option to perform incremental upload or download on objects.
  • ossutil does not automatically delete snapshot information from the folder specified by snapshot-path. You can remove the folder if you no longer use the snapshot information.
  • Additional overheads are required to read and write snapshot information. We recommend that you do not use this option in the following scenarios: The number of objects to upload or download is small. The network is properly connected. Other users need to perform operations on those objects. In this case, you can use the --update option to perform incremental upload or download.
  • The --update and --snapshot-path options can be used together. ossutil first uses the --snapshot-path option to determine whether to skip the upload or download of an object. If the upload or download is not skipped by --snapshot-path, ossutil then uses the --update option to determine whether to skip the upload or download of the object.
--start-time Specifies the timestamp in Linux or Unix. If you enter this option, objects whose last update time is earlier than the timestamp are ignored.
--loglevel Specifies the log level. The default value is null, which indicates that no log files are generated. Valid values: info and debug.
  • info: generates prompt logs.
  • debug: generates detailed logs that contain corresponding HTTP request and response information.
--storage-class Specifies the storage class of an object. Valid values: Standard, IA, Archive, and ColdArchive. Default value: Standard.
-i, --access-key-id Specifies the AccessKey ID used to access OSS. This option value overwrites the corresponding configurations in the configuration file.
-t, --sts-token Optional. This option specifies the STS token used to access OSS. This option value overwrites the corresponding configurations in the configuration file. This option is required only when you use a temporary STS token to access OSS. Otherwise, you can leave this parameter unspecified. For more information about how to generate an STS token, see the "Temporary access credential" section in Authorized third-party upload.
--parallel Specifies the number of concurrent operations performed on a single object. Valid values: 1 to 10000. By default, ossutil automatically sets the value of this option based on the operation type and object size.
--partition-download Specifies the partition to download. The value of this option is in the "partition number: the total number of partitions" format. A value of 1:5 indicates that ossutil downloads partition 1 out of the total five partitions. Partitions are numbered from 1. Partitioning rules for objects are determined by ossutil. This option splits an object to download into multiple partitions that can be downloaded by multiple ossutil commands. Each ossutil command downloads its own partition. You can run multiple ossutil commands on different machines at the same time.
--bucketname Specifies the name of a bucket. This option can be added to the probe command.
--encoding-type Specifies the encoding type of the object name. If this option is specified, this value must be url. Otherwise, the object name is not encoded. Bucket names cannot be URL-encoded.
Notice The value of this option must be in the oss: //bucket/url_encode (object) format. For example, URL oss: //bucket/object must be entered as oss: //bucket/url_encode (object). The oss: //bucket/ string does not need to be encoded.
--origin Specifies the value of the Origin header in an HTTP request. This option value indicates the origin URL of a cross-origin request.
--acr-method Specifies the value of the Access-Control-Request-Method header in an HTTP request. Valid values: GET, PUT, POST, DELETE, and HEAD.
--acr-headers Specifies the value of the Access-Control-Request-Headers header in an HTTP request. This option value indicates header fields, except simple ones, to be used in an actual request. To specify multiple headers, separate different headers with commas (,) and enclose the headers with double quotation marks ("). Example: --acr-headers "header1,header2,header3".
--upload-id-marker Specifies the multipart upload ID from which you want to start listing.
-h, --help Displays help information for a specific command.
--proxy-host Specifies the URL of the proxy server. HTTP, HTTPS, and SOCKS5 proxies are supported. Examples: http://120.79. **.**:3128 and socks5://120.79. **. **:1080.
--proxy-user Specifies the username of the proxy server. The default value is null.
--proxy-pwd Specifies the password of the proxy server. The default value is null.
--trafic-limit Specifies the speed to access the object over HTTP. Unit: bit/s. Valid values: 100 KB/s to 100 MB/s. Default value: 0. 0 indicates that the maximum access speed is unlimited. This option is used in the sign command.
--local-host Specifies the local IP address of the tool. If your computer has multiple IP addresses, you can specify this option so that ossutil can access OSS through the specified IP address. This option is used in the cp command.
--enable-symlink-dir Specifies whether to upload the subfolder of the symbolic link. By default, the subfolder is not uploaded. The probe command can be used to check whether an object or a folder to which the symbolic link points is also a symbolic link.
--only-current-dir Specifies that only objects in the current folder are uploaded, downloaded, or copied. The subfolders in the current folder are ignored.
--disable-dir-object Specifies that no OSS object is generated for the folder during object upload.
--probe-item Specifies the items to be checked by using the probe command. Valid values:
  • upload-speed.
  • download-speed.
  • cycle-symlink: checks whether a symbolic link in the local file folder points to itself.
--redundancy-type Specifies the data redundancy type of a bucket. Valid values: LRS (locally redundant storage) and ZRS (zone-redundant storage). Default value: LRS.
--disable-encode-slash Specifies that forward slashes (/) in the URL path are not encoded.
--disable-all-symlink Specifies that all objects in the subfolder and the subfolder to which the symbolic link points are ignored during object upload.
--tagging Specifies the object tag when you upload or copy an object in the "abc=1&bcd=2&……" format.
--disable-ignore-error Specifies that errors are not ignored during batch operations.