tencent cloud

masukan

Retrieving Archived Files - restore

Terakhir diperbarui:2023-04-17 15:38:53

    The restore command is used to restore archived objects.

    Note:

    For more information on retrieving archived files, see POST Object restore.

    Command Syntax

    ./coscli restore cos://<bucket-name>[/prefix/] [flag]
    

    restore includes the following parameters:

    Parameter Format Description Example
    cos://<bucket-name> Specifies the target bucket, which is accessible by using the bucket alias or bucket name configured in the configuration file as detailed in Download and Installation Configuration. If you use the bucket name for access, you also need to include the endpoint flag. Access with the bucket alias: cos://example-alias
    Access with the bucket name: cos://examplebucket-1250000000
    /prefix/ Specifies a directory (optional). /picture/

    The restore command contains the following optional flags:

    Flag Abbreviation Flag Name Description
    -h --help Views the usage of this command.
    None --include Includes specific objects.
    None --exclude Excludes specific objects.
    -d --days Specifies the expiration time of the temporary file generated during object restoration, which is 3 days by default.
    -m --mode Specifies the restoration mode, which is Standard by default
    -r --recursive Traverses the folder recursively.
    Note:

    • --include and --exclude support standard regular expression syntax, so you can use them to filter out objects that meet specific criteria.
    • When using zsh, you may need to add double quotes at both ends of the pattern string.
      ./coscli restore cos://bucket1/example/ -r --include ".*.mp4"
    • For more general options for this command (such as switching buckets or user accounts), see Common Options.

    Examples

    Restoring archived objects in bucket1 bucket in Standard mode

    ./coscli restore cos://bucket1/picture.jpg
    

    Restoring all archived objects in picture folder in bucket1 bucket in Expedited mode

    ./coscli restore cos://bucket1/picture/ -r --mode Expedited
    
    Note:

    Before running this command, you need to make sure that all objects in the folder are of the same storage class (such as ARCHIVE). If there are objects in different classes, use --include or --exclude to filter out objects in the same class.

    Hubungi Kami

    Hubungi tim penjualan atau penasihat bisnis kami untuk membantu bisnis Anda.

    Dukungan Teknis

    Buka tiket jika Anda mencari bantuan lebih lanjut. Tiket kami tersedia 7x24.

    Dukungan Telepon 7x24