• Object Storage Service

obs
  1. Help Center
  2. Object Storage Service
  3. User Guide (S3cmd)
  4. Operation Guide
  5. Object Management
  6. Copying an Object

Copying an Object

S3cmd provides the object copy command to create a copy for an existing object on OBS.

Procedure

  1. Open the command line tool.
  2. Run a command that varies depending on whether a target object name is specified.

    • Without the target object name specified

      s3cmd cp s3://my-bucket-1/object s3://my-bucket-2

      NOTE:

      It is a good practice to copy an object to different buckets or folders. An object name must be unique in a bucket. If the source object's path is the same as the copy's path, the object's copy fails to be created.

    • With the target object name specified

      s3cmd cp s3://my-bucket-1/object s3://my-bucket-2/object-copy

  3. (Optional) Run the following command to check that the object's copy has been created in a specific bucket.

    s3cmd ls s3://my-bucket-2