How to Installing s3cmd and download from S3 digitalocean on Windows

How to Installing s3cmd and download from S3 digitalocean on Windows
At the moment, there is no direct way to download the files locally or move from one space to another.
You can use tools like s3cmd to download the files and have them saved in your local repositories.
You can setup s3cmd by referring to the link given below

Installing s3cmd on Windows

https://www.digitalocean.com/docs/spaces/resources/s3cmd/

 Installing s3cmd and download from S3 digitalocean on Windows

Yes, however, being written in Python, s3cmd requires Python 2.4+
for Windows to be installed and also it requires the Python library date-util.

Step 1 Download the last version of Python
– https://www.python.org/download/releases/2.4/, I have download the version python-3.8.5 and install it
and open the CMD


 C:\Python38>python --version
Python 3.8.5

Step 2 Download and install date-util
Python recommended to this:Please install the python dateutil module:
$ sudo apt-get install python-dateutil
or
$ sudo yum install python-dateutil
or
$ pip install python-dateutil

Tying to install


C:\Python38>pip install pyton-dateutil
ERROR: Could not find a version that satisfies the requirement pyton-dateutil (from versions: none)
ERROR: No matching distribution found for pyton-dateutil
WARNING: You are using pip version 20.1.1; however, version 20.2.3 is available.
You should consider upgrading via the 'c:\python38\python.exe -m pip install --upgrade pip' command.

That was not working, you can download directly from https://pypi.org/project/python-dateutil/#files
After downloading the “python_dateutil-2.8.1-py2.py3-none-any.whl” copy to pyhon folder C:\Python38>


C:\Python38>pip install python_dateutil-2.8.1-py2.py3-none-any.whl
Processing c:\python38\python_dateutil-2.8.1-py2.py3-none-any.whl
Collecting six>=1.5
  Downloading six-1.15.0-py2.py3-none-any.whl (10 kB)
Installing collected packages: six, python-dateutil
ERROR: After October 2020 you may experience errors when installing or updating packages. This is because pip will change the way that it resolves dependency conflicts.

We recommend you use --use-feature=2020-resolver to test your packages with the new resolver before it becomes the default.

s3cmd 2.1.0 requires python-magic, which is not installed.
Successfully installed python-dateutil-2.8.1 six-1.15.0

Step 3 Download S3cmd
You can download s3cmd https://sourceforge.net/projects/s3tools/
Unzip and copy the file inside the Pyton folder


C:\Python38>python s3cmd --version
s3cmd version 2.1.0

Step 4 Initialize the Configuration File
By default, s3cmd stores its configuration file, .s3cfg, in the home directory of the user that ran the configuration
command. .s3cfg is a plain text file of key/value pairs which can be edited directly once it has been created.

4.1 Configure s3cmd


C:\Python38>python s3cmd --configure
ERROR: Option --preserve is not yet supported on MS Windows platform. Assuming --no-preserve.
ERROR: Option --progress is not yet supported on MS Windows platform. Assuming --no-progress.

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. Leave them empty for using the env variables.
Access Key:
Secret:

Save settings? [y/N] y
Configuration saved to ‘C:\Users\YourUsername\AppData\Roaming\s3cmd.ini’

Step 5 test connection and download files
C:\Python38>python s3cmd ls

Once s3cmd setup is done, you can use s3cmd command to download files recursively in spaces.

s3cmd sync s3://bucketnamehere/folder /destination/folder
or
s3cmd get s3://ukgoodbye/Weekly/mysales/ D:\ukgoodbye\mysales




Comments are Closed