百度智能云

All Product Document

          Object Storage

          Configure BOSCMD

          General Configuration

          The Configuration Supports the Chinese Display

          To configure the CMD environment that supports Chinese display, execute the following commands for configuration:

          $ export LANG=en_US.UTF-8

          Note: Execute the command locale to view the language support of the current environment, if not LANG=en_US.UTF-8, execute the above-mentioned command for modification.

          Configure AK/SK, Region and Host Information

          Prior to the use of BOS CMD tool, it is recommended to set Access Key, Secure Key, Region and Host. Set the AK/SK, Region and Host information by -c/--configure.

          $ bcecmd -c  [<conf-path>] 
          
          $ Your Access Key ID [None]: Enter Your AK 
          
          $ Your Security Token []: Enter Your STS token 
          
          $ Your Secret Access Key ID [None]: Enter Your SK 
          
          $ Default Region Name [bj]: Enter Your region 
          
          $ Default Domain [bj.bcebos.com]: Enter Your host 
          
          $ Default Proxy Host[none]: Enter Your proxy host

          Note:

          • The '' is a local file directory. When a user has multiple accounts of Baidu AI Cloud, he can write the configuration files of different accounts to different directories by specifying ''. When executing the command, the user can specify the directory to select the configuration of the corresponding account.
          • If the <conf-path> is not specified, CMD writes the configuration file automatically under the current master directory ~/.go-bcecli upon the completion of configuration; if the <conf-path> is specified, the configuration file is written to the specified directory automatically.
          • Even if AK/SK is not set, you can access the bucket with public permission via BOS CMD.
          • After specifying Region, you can specify no Host, BOS CMD can match Host to Region.bcebos.com automatically.
          • If you specify the Host, BOS CMD does not match Host automatically, but access the Host you specified.
          • If you specify proxy host, BOS CMD will use proxy to connect BOS service
          • Fill in None to set the AK/SK/Region as well as Domain as null. When Region is set to be null, the default value is bj. When the Domain is set to be null, it defaults to use Region for matching; when both are set to be null at the same time, it defaults for access bj.bcebos.com.
          • Token can be set when temporary STS token is used, and priority is given to Token if Token is configured.

          In addition to the general setting, the command bcecmd -c also supports to set automatic switching of domain name as well as supports to set BOS upload-related attribute, such as whether to use HTTPS protocol as well as the concurrency of multi-part upload.

          Set Automatic Switching of Domain Name

          BOS has multiple Regions, and if you need to operate under different Regions, the "automatic switching of domain name" of BOS CMD can switch the domain name automatically according to the Region where the bucket you operate is located. To facilitate your use, CMD enables such function by default.

          If you want all your action requests to be sent to the domain name you specified or to Host (a domain configured by bcecmd -c, you can disable the function of "automatic switching of domain name" by the command bcecmd -c, and no indicates to disable such function.

          $ bcecmd -c [<conf-path>] 
          
          $ Default use auto switch domain [yes]: 

          Note: The value can be yes and no, among which yes represents to enable the automatic switching of domain name for the Region where the bucket is located, and no represents to disable such function. Such function is enabled by default.

          Set HTTPS Protocol for Upload

          In order to ensure the security of the user's data, the user is recommended to Use HTTPS Protocol for Upload. Whether or not to use HTTPS can be set by the command bcecmd -c, and HTTPS Protocol for Upload is used if no is set.

          $ bcecmd -c [<conf-path>] 
          
          $ Default use https protocol [no]: 

          Note: The value can be yes and no, the HTTPS Protocol for Upload is used by default.

          Set the Concurrency for the Multipart Upload of Large Files

          When BOS CMD is used to upload the file greater than 32MB, BOS CMD uploads it in multi-parts automatically, and you can set the concurrency for multi-part upload of a single file.

          $ bcecmd -c [<conf-path>] 
          
          $ Default multi upload thread num [10]: 

          Note: The concurrency for multi-part upload shall be set to be an integer greater than or equal to 1, and it defaults to be 10.

          Set the Number of Files Uploaded and Downloaded Concurrently by the Command BOS CMD Sync.

          When BOS CMD executes the upload and download via the command sync, it operates multiple files concurrently. You can set the concurrency for the command sync via the command bcecmd -c.

          $ bcecmd -c [<conf-path>] 
          
          $ Default sync processing num [10]: 

          Note: The concurrency is set to be an integer greater than or equal to 1, and it defaults to be 10.

          Note: When the command sync is used, sync processes multiple files concurrently, and if the size of a file exceeds the threshold value for multi-part upload, the files is divided into parts and then uploaded concurrently, so the coroutines of "sync concurrency * concurrency for multi-part upload of a single file" operate at the same time under the worst case; however, it does not means that the higher the concurrency, the higher the upload efficiency will be, so you need to configure the appropriate sync concurrency and the concurrency for multi-part upload according to the configuration of your computer.

          Set the Size of a Single Part for Multi-part Upload

          The default size of a single part by BCE CMD is 10Mb, if you have a good network environment (no time-out occurs when you upload the file using the default block size), you are recommended to use the default size. In case of time-out during the upload (the error code returned by BOS is RequestTimeout); you are recommended to reduce the size of a single part to avoid timeout. You can configure the block size by the following commands:

          $ bcecmd -c [<conf-path>] 
          
          $ Default multi upload part size [10] MB (Must be positive integer and equal or greater than 1) : 

          Note:

          • The block size is set to be an integer greater than or equal to 1, and it defaults to be 10 (unit: Mb).
          • If you have an unsatisfactory network environment, you are also recommended to reduce the [Number of Files Uploaded and Downloaded Concurrently by the Command Sync](#Set the Number of Files for Concurrent Upload and Download by BOS CMD Sync Command) and [Concurrency for Multi-part Upload of Large Files](#Set the Concurrency for Multi-part Upload of Large Files).
          Previous
          Install BOSCMD
          Next
          Use of Bos Services by cmd