Object Storage Service (OSS) provides various methods to access and manage objects. To improve operational efficiency, you can perform the operations described in this topic to manage objects at a time. For example, you can upload, download, replicate, and delete multiple objects at a time.
Upload multiple objects at a time
You can use the following methods to upload multiple objects at a time:
ossimport
Use ossimport to migrate data to OSS from data sources, such as local servers, OSS, and third-party cloud storage services like Amazon Simple Storage Service (Amazon S3), Azure Blob, and Tencent Cloud Object Storage (COS). ossimport is especially suitable for the migration of large amounts of data. For more information, see Overview.
-
ossutil
Use the cp command with the -r (--recursive) option to upload objects to OSS in batches. For more information, see Upload objects in batches by using ossutil.
-
ossbrowser
Use ossbrowser to select multiple objects and upload them to OSS. For more information, see Common operations.
OSS console
Upload multiple objects to OSS at a time by using the OSS console. For more information, see Simple upload.
ZIP package decompression
Configure decompression rules, compress multiple local files into a ZIP package, and then upload the ZIP package to OSS. Then, Function Compute is triggered to decompress the ZIP package and upload the decompressed files to OSS. For more information, see ZIP package decompression.
Download multiple objects at a time
If you want to download multiple objects by object information, such as the last modified time, filter matching objects based on an inventory and use one of the following methods to download the objects.
You can use the following methods to download multiple objects at a time:
-
ossutil
Use the cp command of ossutil with the -r (--recursive) option to download all objects from a specified directory to your local machine. For more information, see Download objects in batches by using ossutil.
-
ossbrowser
Use ossbrowser to select multiple objects or directories and download them to your local device. For more information, see Common operations.
-
OSS console
Use the OSS console to select multiple objects and download them to your local device. For more information, see Simple download.
-
Package and download objects
Use Function Compute to package multiple objects into a single archive for local download. For more information, see Package multiple objects into a ZIP archive for download.
Copy multiple objects at a time
You can use the following methods to copy multiple objects at a time:
CRR
Use cross-region replication (CRR) to replicate objects whose names contain a specific prefix at a time. You can choose whether to synchronize historical data and whether to synchronize deletion operations. For more information, see CRR within the same account.
-
ossutil
Use the cp command with the -r (--recursive) option to copy objects in a specified directory to another directory, or to another bucket in the same account. For more information, see Copy objects in batches by using ossutil.
-
ossbrowser
Use ossbrowser to select multiple objects or directories and copy them to another directory or another bucket under the same account. For more information, see Common operations.
Delete multiple objects at a time
You can use the following methods to delete multiple objects at a time:
You cannot recover deleted objects. Exercise caution when you perform this operation.
OSS SDK
Use SDKs to delete multiple objects at a time.
For examples of deleting objects by using OSS SDKs for other programming languages, see Overview.
OSS API
Call the DeleteMultipleObjects operation to delete multiple objects at a time. For more information, see DeleteMultipleObjects.
-
ossutil
Use the rm command of ossutil with the -r (--recursive) option to delete all objects that match a specified prefix. For more information, see Delete objects in batches by using ossutil.
-
ossbrowser
Use ossbrowser to select and delete multiple objects or directories at once. For more information, see Common operations.
-
OSS console
-
Select and delete multiple objects in the OSS console. For more information, see Delete objects.
You can also delete an entire directory, which removes all objects within it.
-
Use the Delete parts feature in the OSS console to delete incomplete multipart upload parts in batches. For more information, see Delete parts.
-
-
lifecycle rule
Configure a lifecycle rule to automatically delete objects in batches. For more information, see Lifecycle rules based on last modified time.
Change the storage classes of multiple objects at a time
You can use the following methods to change the storage classes of multiple objects at a time:
-
ossutil
Use the set-props command with the --storage-class and -r (--recursive) options to change the storage class of specified objects in batches. For more information, see set-props (Set object properties).
Lifecycle rules
Configure lifecycle rules to automatically change the storage classes of multiple objects at a time. For more information, see Lifecycle rules based on the last modified time.
Change the access control lists (ACLs) of multiple objects at a time
You can use ossutil to change the ACLs of multiple objects at a time.
-
Use the set-props command of ossutil with the --acl and -r (--recursive) options to change the ACL for multiple objects. For more information, see set-props (Set object properties).
Restore multiple objects at a time
You can use the following methods to restore multiple Archive and Cold Archive objects at a time:
-
ossutil
Use the restore command with the -r (--recursive) option to restore multiple frozen objects at once. For more information, see Restore objects in batches by using ossutil.
ossbrowser
Use ossbrowser to select objects that you want to restore and restore them at a time.
Modify the metadata of multiple objects at a time
You can use the following methods to modify the metadata of multiple objects at a time:
-
ossutil
Use the set-props command of ossutil with the --metadata and -r (--recursive) options to modify the metadata for multiple objects. For more information, see set-props (Set object properties).
OSS console
Change the metadata of multiple objects at a time by modifying the HTTP headers of the objects in the OSS console. For more information, see Manage object metadata.