0
0

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 1 year has passed since last update.

Cloud9での開発環境構築

Last updated at Posted at 2023-05-20

#!/bin/bash

# コピー元のS3バケット名とプレフィックス
source_bucket="your-source-bucket"
source_prefix="your-source-prefix/"

# コピーする日付(YYYY-MM-DD形式)
copy_date="2023-05-31"

# コピー元のS3バケットから指定日付以降のオブジェクトをローカルにコピーする
aws s3api list-objects --bucket $source_bucket --prefix $source_prefix --output json --query 'Contents[?LastModified>=`'"$copy_date"'T00:00:00`].{Key: Key}' | jq -r '.[].Key' | xargs -I {} aws s3 cp "s3://$source_bucket/{}" "{}"
0
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?