AWS CLI(S3)

バケットの作成

aws s3 mb s3://mybucket


ファイルのコピー
aws s3 cp /root/a.txt s3://mybucket

aws s3 cp /root/testdir s3://mybucket \
--recursive


aws s3 cp /root/b.txt s3://mybucket \
--storage-class STANDARD

aws s3 cp /root/c.txt s3://mybucket \
--storage-class REDUCED_REDUNDANCY

aws s3 cp /root/d.txt s3://mybucket \
--storage-class STANDARD_IA

aws s3 cp /root/e.txt s3://mybucket \
--storage-class ONEZONE_IA

aws s3 cp /root/f.txt s3://mybucket \
--storage-class INTELLIGENT_TIERING

aws s3 cp /root/g.txt s3://mybucket \
--storage-class GLACIER

aws s3 cp /root/h.txt s3://mybucket \
--storage-class DEEP_ARCHIVE

 

aws s3 cp s3://mybucket/a.txt /root/a.txt

aws s3 cp s3://mybucket/dir1 /root/testdir \
--recursive


ファイルの一覧
aws s3 ls s3://mybucket

 

aws s3 ls s3://mybucket \
--recursive \
--human-readable \
--summarize

 

ファイルの削除
aws s3 rm s3://mybucket/a.txt


aws s3 rm s3://mybucket/dir1 \
--recursive


ファイルの移動

aws s3 mv /root/a.txt s3://mybucket
aws s3 mv s3://mybucket/a.txt /root/a.txt


ファイルの同期

aws s3 sync /root/dir2 s3://mybucket/dir2 \
--delete


バケットの削除
aws s3 rb s3://mybucket \
--force