0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[AWS]同S3バケット内のファイルコピー

Posted at

S3アクセスログなどで、同じS3バケット内でコピーを実行する場合、
以下のようなコマンドでは、コピー後のファイルが再帰的にコピーされてしまう。

cmd
aws s3 cp s3://test-qiita-bucket/ s3://test-qiita-bucket/logs/2019/02/17/ \
--recursive \
--exclude "*" \
--include "logs/2019-02-17*"

コピー後の再帰コピーを防止するため、コピー後のパスをexcludeする。
こうすることで、同じバケット内のコピーが気兼ねなく行える。

cmd
aws s3 cp s3://test-qiita-bucket/ s3://test-qiita-bucket/logs/2019/02/17/ \
--recursive \
--exclude "*" \
--include "logs/2019-02-17*" \
--exclude "logs/2019/02/17/"
0
1
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
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?