The s3cmd
tool can be used for managing object storage. This page shows you
how to install and configure the package before using storage buckets and
objects.
Install s3cmd tool CLI
The s3cmd
tool is a command-line tool for managing object storage.
- To download the tool, navigate to the directory from where the GDC bundle was extracted.
Run the following commands to extract the s3cmd image,
s3cmd.tar.tar.gz
, to an empty temporary directory:tmpdir=$(mktemp -d) gdcloud artifacts extract oci/ $tmpdir \ --image-name=$(gdcloud artifacts tree oci | grep s3cmd.tar | sed 's/^.* //')
scp
the tar file to a client machine where you uses3cmd
for object operations; extract and install the image.
Choose one of the following installation methods to install the s3cmd
tool:
Install through tar file
To unpack the archive and install the
s3cmd
package, run the following commands. You must have the Pythondistutils
module to install the package. The module is often part of the core Python package or you can install it using your package manager.tar xvf /tmp/gpc-system-tar-files/s3cmd.tar.tar.gz cd /tmp/gpc-system-tar-files/s3cmd sudo python3 setup.py install
Optional: Clean up the downloaded files:
rm /tmp/gpc-system-tar-files/s3cmd.tar.tar.gz rm -r /tmp/gpc-system-tar-files/s3cmd
Install with docker image
To install the
s3cmd
image, run the following commands:docker load --input s3cmd-docker.tar export S3CFG=/EMPTY_FOLDER_PATH/ alias s3cmd="docker run -it --net=host --mount=type=bind,source=/$S3CFG/,target=/g/ s3cmd-docker:latest -c /g/s3cfg"
Optional: Clean up the downloaded files:
rm s3cmd-docker.tar
Add the export and alias to the
.bashrc
file to persist after restarting the client.
Configure the s3cmd tool
Use the s3cmd tool for object-based operations.
Run the s3cmd --configure
command and specify the following:
- Access Key: Enter the access key obtained from the secret in getting access credentials.
- Secret Key: Enter the secret key obtained from the secret in getting access credentials.
- Default Region: Press
ENTER
. - S3 Endpoint: Enter the endpoint your Infrastructure Operator (IO) provides.
- For DNS style bucket naming, enter
s3://%(bucket)
. - Optional: Enter an encryption password to protect files in transit.
- In Path to GPG, enter
/usr/bin/gpg
. - Enter
Yes
to use the HTTPS protocol. - Press
Enter
to skip entering the proxy server name.