s3cmd

Reading Time: < 1 minute

Last Updated: 5/28/2024

Installation:

root@node1:~# apt install s3cmd

Configure:

This is the quick edit version.
Use the “s3cmd –configure” command to ask a lot of questions the configuration to be used. In this example I am using a local version of S3 that is hosted provided for by “minio”.

s3cmd --configure

TIP:

Let’s make out live easier and install a cmd line utility which will make it easier to edit INI files with. There are similar programs for windows (on ss64 if I remember right) but I am not mentioning the windows version for the moment.

apt install crudini

Once the “crudini” utility is installed it’s easy to make sure a few basic values are in place.

crudini --get .s3cfg default check_ssl_certificate
crudini --set .s3cfg default check_ssl_certificate False
crudini --set .s3cfg default check_ssl_certificate True

In our example we will set the check_ssl_certificate setting to False

crudini --set .s3cfg default check_ssl_certificate False

For S3CMD to parse and function correction I also had to set the host_bucket. Most s3cmd commands can also use a –debug function.

crudini --set .s3cfg default host_bucket 192.168.160.59:9000
crudini --get .s3cfg default host_bucket 

To find visible root level buckets.

root@node1:~# s3cmd ls
2024-05-15 22:38  s3://mp3
2024-05-15 22:20  s3://spare
2024-05-15 20:30  s3://thomas

Finding contents of a particular bucket.

root@node1:~# s3cmd ls s3://thomas/
                          DIR  s3://thomas/subfolder1/
2024-05-15 21:14            2  s3://thomas/note.txt
2024-05-18 01:32            9  s3://thomas/ok.txt
2024-05-15 22:22           20  s3://thomas/other.txt

info

root@node1:~# s3cmd du
           0       0 objects s3://mp3/
          72       1 objects s3://spare/
          31       4 objects s3://thomas/
------------
103          Total

info

s3cmd get s3://thomas/ok.txt
download: 's3://thomas/ok.txt' -> './ok.txt'  [1 of 1]
 9 of 9   100% in    0s     3.40 KB/s  done

reference:
https://manpages.ubuntu.com/manpages/jammy/man1/s3cmd.1.html
https://s3tools.org/s3cmd-howto
https://s3tools.org/usage

This entry was posted in S3, Storage. Bookmark the permalink.