4
4

More than 5 years have passed since last update.

AWSコマンドメモ

Posted at

一覧表示

> aws s3 ls --recursive s3://<bucket>..

ls にも --recursive オプションはあるはずなのに、昨年末まで未実装(というか素で忘れていた気配)だったようなので、unknown option --recursiveと言われた人はpip install --upgradeをしましょう。

参考: https://github.com/aws/aws-cli/issues/465

出力は

2013-10-08 19:05:59          0 test/
2014-02-25 04:07:31 2060138324 test/test.tar.bz2
2014-01-27 04:08:44      70401 mysql/rose/140127/blog.sql.gz
2013-10-08 19:06:12          0 repo/
2014-01-26 03:49:06  603526574 repo/repo.tar.bz2

こんなフォーマットになっていますので、

aws s3 ls --recursive s3://<bucket>/ | awk 'BEGIN{s=0}{s+=$3;}END{print s};' とすれば、バケット内の総容量がわかるはずです。

4
4
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
4
4