LoginSignup
22
11

More than 5 years have passed since last update.

Amazon S3 からディレクトリ単位でダウンロードする方法

Last updated at Posted at 2018-06-14

ストレージしてあるログをディレクトリ単位でまとめてダウンロードしたかったが、
S3 の GUI にあるダウンロード選択肢が非活性化してたので、AWS CLI を使って取得したときのメモ。
AWS CLI の説明は省略します。

AWS CLI のインストール

https://docs.aws.amazon.com/ja_jp/cli/latest/userguide/installing.html
※ インストール後にアクセスキーなどの設定が必要です。

AWS CLI で Amazon S3 からディレクトリ単位でダウンロードするコマンド

プロファイルを複数設定しているときは --profile production のように対象プロファイルを指定します。

  1. sync コマンド
    aws s3 sync s3://myBucket/targetDir /localDir
  2. cp コマンド
    aws s3 cp s3://myBucket/targetDir /localDir --recursive

-- 追記
sync って名前いかにも副作用ありそうな顔してるから後でちゃんと調べる

22
11
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
22
11