file

What batch operations does OSS have?

important

This article contains important information that needs your attention. Ignoring this information may affect your business. Please read it carefully.

Object storage OSS provides rich ways to access and manage files (Objects). To improve operation efficiency, you can refer to the methods shown in this article to batch manage files, such as batch upload, download, copy, and delete files.

Batch upload

You can use the following methods to upload files in batches:

  • Ossimport tool

    It supports batch migration of data from server local, third-party cloud storage (S3, Azure, Tencent COS, etc.), OSS and other data sources to OSS, especially in the case of a large amount of data. For details, see Overview of ossimport

  • Ossutil tool

    Use the ossutil tool's cp Command -r(--recursive) Option. You can upload files to OSS in batch. For details, see Cp (upload file)

  • Ossbrowser tool

    Use the ossbrowser tool to batch select files and upload them to OSS. For details, see Upload file

  • OSS Console

    Use the OSS console to batch select files and upload them to OSS. For details, see Simple upload

  • ZIP package decompression

    Use the ZIP package decompression function. First configure the decompression rules, and then package multiple files into ZIP packages and upload them to OSS. At this point, the trigger function calculation is decompressed and the decompressed file is returned to OSS for batch upload. For details, see ZIP package decompression

Batch download

explain

If you want to download files in batches according to file information, such as the last update time. You can use the Storage space list Filter out the list of files that meet your expectations, and then use the following methods to download in batches.

You can use the following methods to download files in batches:

  • Ossutil tool

    Use the ossutil tool's cp Command -r(--recursive) Option to batch download the files in the specified file directory to the local. For details, see Cp (download file)

  • Ossbrowser tool

    Use the ossbrowser tool to check multiple files or file directories and download them locally in batches. For details, see Download files

  • OSS Console

    Use the OSS console to check multiple files and download them locally in batches. For details, see Simple download

  • Download files after packaging

    In combination with the function calculation service, you can package and download batch files locally. For details, see Use function calculation to package and download OSS files

Bulk Copy

You can use the following methods to batch copy files:

  • Cross region replication

    You can batch copy the specified prefix files through cross region copying. You can also choose whether to synchronize historical data and delete operations. For details, see Cross region replication of the same account

  • Ossutil tool

    Use the ossutil tool's cp Command -r(--recursive) Option to batch copy files in the specified file directory to another file directory or another storage space under the same account. For details, see Cp (copy file)

  • Ossbrowser tool

    Use the ossbrowser tool to check multiple folders or files and copy one or more files to another file directory or another storage space under the same account. For details, see Copy File

Batch deletion

You can use the following methods to delete files in batches:

warning

The file cannot be recovered after deletion. Please be careful.

  • OSS SDK

    Use the SDK to delete files in batches.

    For more language SDK examples, see SDK Reference

  • OSS API

    adopt DeleteMultipleObjects in OSS The interface can delete files in batches. For details, see DeleteMultipleObjects

  • Ossutil tool

    Use ossutil's rm Command -r(--recursive) Option to batch delete files with the specified prefix. For details, see Delete File

  • Ossbrowser tool

    Use the ossbrowser tool to select multiple files or file directories and delete them in batches. For details, see Delete File

  • OSS Console

    • Use the OSS console to check multiple files and delete them in batches. For details, see Delete File

      You can also delete a file directory directly, and the files in the file directory will be deleted at the same time.

    • Use the fragment management function of the OSS console to delete fragments in batches. For details, see Delete Fragments

  • Life cycle rules

    Automatically delete your files in batches through lifecycle rules. For details, see Life cycle rules based on the last modification time

Batch Modify File Storage Type

You can use the following methods to batch modify the storage type of files:

Batch Modify File Access Permissions (ACLs)

You can modify the file ACL in batch through the ossutil tool:

  • use set-acl Command -r(--recursive) Option to batch modify the ACL of the specified file. For details, see Set acl (set or modify ACL)

  • use set-meta Command combination -r(--recursive) Option to modify the ACL of a file by modifying the meta information of the specified file. For details, see Set meta (manage file metadata)

Batch unfreeze files

You can use the following methods to batch restore files in the "frozen" state of archive storage to readable status:

  • Ossutil tool

    use restore Command -r(--recursive) Option. Files in batch recovery frozen status are readable. For details, see Restore (unfreeze files)

  • Ossbrowser tool

    Use the ossbrowser tool to check the files that need unfreezing and unfreeze them in batches.

Batch setting file meta information

You can use the following methods to batch modify the meta information of files:

  • Ossutil tool

    Use ossutil's set-meta Command -r(--recursive) Option to batch modify the meta information of the specified file. For details, see Set meta (manage file metadata)

    This command can be used to batch modify the storage type and file access permissions of files.

  • OSS Console

    Check the file that needs to modify the Http head information on the console, and set the meta information of the file in batch. For details, see Manage file metadata

  • Introduction to this page (1)