#author("2023-02-20T12:20:36+00:00","default:hotate","hotate")
#author("2023-02-26T08:28:44+00:00","default:hotate","hotate")
#contents
&tag(AmazonS3, AWS);
&tag(AmazonS3,AWS,Python);

* 情報 [#a375169d]
- [[Amazon S3 Tools: S3cmd Usage>http://s3tools.org/usage]]
 The following is S3cmd usage (as shown if you type s3cmd -h). To access all the options and commands listed below, you'll need version 1.5
- [[s3tools/s3cmd: Official s3cmd repo -- Command line tool for managing Amazon S3 and CloudFront services>https://github.com/s3tools/s3cmd]]
 Official s3cmd repo -- Command line tool for managing Amazon S3 and CloudFront services
- [[Amazon S3 編。S3 を s3cmd で操作する方法をご説明 | 使い方・ナレコムAWSクラウド | ナレコムAWSレシピ>http://recipe.kc-cloud.jp/archives/1059]]
 バックアップ処理など、スクリプト操作をおこないたい等の場合は、このs3cmdが便利です。
- [[Linux端末からAmazon S3にファイルをアップロードする(s3cmd使用) at nkjmkzk.net>http://www.nkjmkzk.net/?p=1618]]
 コマンドラインでS3を操作できるs3cmdなんて便利なものがあるのですね。早速インストールして使ってみました。
- [[amazon web services - Setting Content-Type for static website hosted on AWS S3 - Stack Overflow>http://stackoverflow.com/questions/16125897/setting-content-type-for-static-website-hosted-on-aws-s3]]
 sudo pip install python-magic
-- [[ahupp/python-magic: A python wrapper for libmagic>https://github.com/ahupp/python-magic]]
 Windows
 You'll need DLLs for libmagic. @julian-r maintains a pypi package with the DLLs, you can fetch it with:
 pip install python-magic-bin
- [[s3cmd --help 日本語訳 - Qiita>https://qiita.com/scalewallet/items/16b429cb2cdc13f742bf]] ([[2019]]/07/17)
 s3cmdすら今更感がありますが、version 1.5.2準拠です(最新は2.0.2のよう)。

** [[バックアップ]] [#i62efb71]
- [[s3cmdでS3に簡単アップロード - MakeitSmart!>http://makeitsmartjp.com/2013/01/s3-s3cmd.html]]
 バケットを作成したりファイルやフォルダをアップロードしたり公開設定を指定したりといった事が簡単にできます。
- [[s3cmdを使ってEC2からS3にDBバックアップ - Qiita>http://qiita.com/hilotter/items/94765ee7be61e30ba67f]]
 バックアップ用のS3バケットを用意して、S3にDBをバックアップするようにしてみました。

** [[Windows]] [#y3b750e0]
- 下記のバッチファイルを作成する。([[Python]]は[[winget]]でインストール済)
 C:\Users\hotate\AppData\Local\Programs\Python\Python310\Scripts\s3cmd.bat
- バッチファイルに下記を記載する。(処理:同じフォルダに存在する"s3cmd"(拡張子無し)を呼び出す)
 python %~dp0\s3cmd %*
- 上記のバッチファイルを呼び出す。
 >s3cmd.bat

* 関連 [#qe48dcb0]
- [[AmazonS3]]

トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS