• Object Storage Service

obs
  1. Help Center
  2. Object Storage Service
  3. User Guide (S3cmd)
  4. Operation Guide
  5. Operation Example

Operation Example

Scenario

An enterprise wants to back up its critical data. However, its storage and servers encounter many problems, such as huge initial investments, low security, and high maintenance costs. Therefore, this enterprise chooses to subscribe to OBS to store backup data.

In such a scenario, requirements are as follows:

  • This enterprise requires encryption to enhance data security.
  • A large amount of data to be uploaded requires multipart upload and resumable upload.

Procedure

  1. Open the command line tool.
  2. Run the following command to create a bucket that stores backup data. Bucket company-backup-data is an example.

    s3cmd mb s3://company-backup-data

  3. Run the following command to upload local data to OBS:

    s3cmd put --recursive --ssl --multipart-chunk-size-mb=5120 --encrypt --continue-put /upload-foler/ s3://company-backup-data

    Table 1 describes the parameters in this command.

    Table 1 Parameters

    Parameter

    Description

    --recursive

    Recursively uploads objects. If the object to be uploaded is a folder with a multi-level directory structure, you can upload the parent-level object (this folder) first and then the child-level objects (files in this folder) in a recursive manner.

    --ssl

    Uploads objects over HTTPS, ensuring data security during transmission.

    --multipart-chunk-size-mb=5120

    Uploads data in multiparts and sets the size of each part to 5120 MB. By doing so, the data amount for the first upload is large. Even if the upload is suspended unexpectedly, parameter --continue-put can be used in the command to resume the upload.

    --continue-put

    Enables resumable upload when the upload is suspended unexpectedly.

    --encrypt

    Enables client-side encryption, meeting enterprise requirements on data security.

    /upload-foler/

    Specifies the path that stores the enterprise's local data.

    s3://company-backup-data

    Specifies the path to which data is uploaded on OBS.

    In the command output, if done is displayed at the end of all objects uploaded, and the cursor appears on the CLI again, it indicates that all objects have been uploaded.