赞
踩
目录
3.Linux 使用AWS-CLI下载亚马逊 S3的多个目标
What is the AWS Command Line Interface? - AWS Command Line Interface
- #下载安装文件
- curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
- #解压安装文件
- unzip awscliv2.zip
-
-
- #默认安装路径
- /home/xxx/Tools/AWS_CLI/2023.11
- #指定安装路径
- ./aws/install -i /home/xxx/Tools/AWS_CLI/2023.11 -b /home/xxx/Tools/AWS_CLI/2023.11
-
- ##--install-dir or -i – This option specifies the directory to copy all of the files to.
- ##--bin-dir or -b – This option specifies that the main aws program in the install directory is symbolically linked to the file aws in the specified path.
- ## You must have write permissions to the specified directory.
- ## Creating a symlink to a directory that is already in your path eliminates the need to add the install directory to the user's $PATH variable.
- #在安装路径下进行配置
- ./aws configure
- #配置完成后,可知/home/.aws/目录下查看配置文件
注意事项:
配置时,需创建用户
What is Amazon S3? - Amazon Simple Storage Service
The following example shows how you can use the AWS CLI to download all of the files or objects under the specified directory or prefix. This command copies all objects from the bucket
to your current directory. To use this example command, use your bucket name in place of DOC-EXAMPLE-BUCKET1
.DOC-EXAMPLE-BUCKET1
aws s3 cp s3://DOC-EXAMPLE-BUCKET1 . --recursive
The following command downloads all of the objects under the prefix
in the bucket logs
to your current directory. It also uses the DOC-EXAMPLE-BUCKET1
--exclude
and --include
parameters to copy only objects with the suffix
. To use this example command, replace the .log
with your own information.user input placeholders
注意事项:Use of Exclude and Include Filters
s3 — AWS CLI 2.13.34 Command Reference
- #使用AWS-CLI下载多个目标
- aws s3 cp s3://DOC-EXAMPLE-BUCKET1/logs/ . --recursive --exclude "*" --include "*.log"
- #AWS CLI Access (No AWS account required)
- aws s3 cp --no-sign-request s3://DOC-EXAMPLE-BUCKET1/logs/ . --recursive --exclude "*" --include "*.log"
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。