S3cmd is created for managing S3 buckets on Linux servers. But we also use this tool on windows servers as well. This article will help you to setup s3cmd in windows systems. If you are searching here to setup s3cmd on Linux system read next article install s3cmd on Linux.
S3cmd System Requirements: s3cmd required Python 2.7 or greater version to run. We also need to install GPG.
Step 1 – Install Python
Download and install python 2.7 or the higher version from python official site and install it.
https://www.python.org/downloads/
After installing python, append the Python in
C:> python --version Python 2.7.6
Step 2 – Install GPG on Windows
Gpg4win (GNU Privacy Guard for Windows) is Free Software to install. Use the following link to download and install it.
http://www.gpg4win.org/download.html
Step 3 – Configure S3cmd
Download latest s3cmd source code from s3cmd official page and extract to c:s3cmd location.
After extracting source code, use following command to setup s3 environment. It will ask for your s3 accounts AccessKey and SecretKey, the path to GPG command like below.
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:XXXXXXXXXXXXXXXXXXXX Secret Key:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Encryption password is used to protect your files from reading by unauthorized persons while in transfer to S3 Encryption password:XXXXXXXXX Path to GPG program:C:\Program Files (x86)\GNU\GnuPG\gpg2.exe 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]:Yes New settings: Access Key: XXXXXXXXXXXXXXXXXXXX Secret Key: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Encryption password: XXXXXXXXX Path to GPG program: C:Program Files (x86)GNUGnuPGgpg2.exe Use HTTPS protocol: True 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... Success. Encryption and decryption worked fine :-) Save settings? [y/N]Y Configuration saved to 'C:\Users\Administrator\Application Data\s3cmd.ini'
Step 4 – Verify S3cmd
To verify s3cmd configuration use following command. It will list the buckets create in your configured s3 account.
C:> python c:\s3cmd\s3cmd ls 2014-02-03 06:37 s3://tecadmin 2014-03-29 07:56 s3://tecadminbackups
5 Comments
You cannot install Python using that file in step one. The command python –version simply returns an error as:
‘python’ is not recognized as a operable program or batch file.
hello, I did staps 1-2, When Iām doing step3, I got this error:
Path to GPG program: C:\Program Files (x86)\GnuPG\bin\gpg.exe
Use HTTPS protocol: True
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…
ERROR: Test failed: close_fds is not supported on Windows platforms if you redirect stdin/stdout/stderr
Retry configuration? [Y/n] n
Do you have any idea?
Regards,
Denis
@INO
if it’s a package, try C:\dateutil>python setup.py install
Hi ,
Thanks for this article. I did steps 1-2. When I’m doing step3, I got this error:
C:\s3cmd\s3cmd-1.6.1>python s3cmd –configure
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
ImportError trying to import dateutil.parser.
Please install the python dateutil module:
$ sudo apt-get install python-dateutil
or
$ sudo yum install python-dateutil
or
$ pip install python-dateutil
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
So I went to https://pypi.python.org/pypi/python-dateutil/2.5.3 and download the dateutil. I tried putting the folder in C:\ and inside the Python installation folder and I’m still getting the error.
Do you have any idea? I’d be greatful for anyone who can help me.
Thanks in advance. Cheers!
Hello, I am attempting to get all this setup on a remote Windows server and i keep getting the following error when I try to configure s3. Not sure I have it in the proper location. But I moved the extracted s3 package to C:s3cmd.
Also (terrible with windows) how do I get the path variable to stick? Used:
set PATH=%PATH%;C:Python32
but every time cmd is restarted it no longer exists in PATH.
C:>python s3cmd –configure
C:Python34python.exe: can’t find ‘__main__’ module in ‘s3cmd’
Best,
Brendan Hasemeier