私は長い間s3cmdユーティリティに精通していましたが、常にLinuxシステムでのみ使用していました。 Windowsで使用できるという事実は、私も考えていませんでした。
どうして? Pythonで実装されているため、クロスプラットフォームです。 PythonをWindowsマシンにインストールするだけです。
だから:
- ステップ1-Pythonをインストールします 。
- ここからインストールパッケージバージョン2.x(3.xはサポートされていません) をダウンロードします
- インストールを開始します。 デフォルトでは、インストールはc:\ Python2.xフォルダーにあります
- システム変数->パスにPythonエントリを追加します。
- Pythonがcmdからアクセス可能であることを確認します
C:\Users\Oleksandr_Molchanov>python Python 2.6 (r26:66721, Oct 2 2008, 11:06:43) [MSC v.1500 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.
- ステップ2-S3cmdをインストールおよび構成します 。
- ここからユーティリティをダウンロードし、たとえばCで展開します:\ s3cmd
- 承認を設定します。
c:\s3cmd>python s3cmd --configure Enter new values or accept defaults in brackets with Enter. Refer to user manual for detailed description of all options. Access key and Secret key are your identifiers for Amazon S3 Access Key : ###################### Secret Key : ###################### Encryption password is used to protect your files from reading by unauthorized persons while in transfer to S3 Encryption password: Path to GPG program [None]: When using secure HTTPS protocol all communication with Amazon S3 servers is protected from 3rd party eavesdropping. This method is slower than plain HTTP and can't be used if you're behind a proxy Use HTTPS protocol [No]: On some networks all internet access must go through a HTTP proxy. Try setting it here if you can't conect to S3 directly HTTP Proxy server name: New settings: Access Key: ####################### Secret Key: ###################### Encryption password: Path to GPG program: None Use HTTPS protocol: False HTTP Proxy server name: HTTP Proxy server port: 0 Test access with supplied credentials? [Y/n] Y Please wait, attempting to list all buckets... Success. Your access key and secret key worked fine :-) Now verifying that encryption works... Not configured. Never mind. Save settings? [y/N] y Configuration saved to 'C:\Users\Oleksandr_Molchanov\Application Data\s3cmd.ini'
- 作業を確認します
c:\s3cmd>python s3cmd mb s3://molchanov Bucket 's3://molchanov/' created c:\s3cmd>python s3cmd ls 2013-05-27 12:39 s3://molchanov
セットアップは非常にシンプルで迅速であることが判明しました。
これで、取得した機能をバットスクリプトでラップできます。これにより、たとえば必要なデータをアーカイブし、S3にきちんと追加できます。
簡単なスクリプトの例:
「C:\ Program Files \ 7-Zip \ 7z.exe」a -t7z d:\%date%.7zip d:\ data1
python C:\ s3cmd \ s3cmd put D:\%date%.7zip s3:// molchanov /
python C:\ s3cmd \ s3cmd put D:\%date%.7zip s3:// molchanov /
これまたは同様のスクリプトへの呼び出しをタスクスケジューラに追加して、データバックアップを整理できます。