Skip to content

Instantly share code, notes, and snippets.

@YordanGeorgiev
Last active August 17, 2018 08:13
Show Gist options
  • Save YordanGeorgiev/d5cab7ecb7055c6bfb0808222c762ef5 to your computer and use it in GitHub Desktop.
Save YordanGeorgiev/d5cab7ecb7055c6bfb0808222c762ef5 to your computer and use it in GitHub Desktop.
[aws s3cmd how-to] aws s3cmd how-toc #aws #s3cmd #config #s3cmd-config
# set those var names ( not the values ;o) in your shell
# good luck trying those ...
export aws_profile=my-profile
export bucket=phub-1525928545-127
export endpoint=https://es-si-s3-z2.ecloud.comm.net:1010
export aws_secret_access_key=56FDD9520FF3F9DA835A6E36f783903
export aws_access_point_id=49585117C01847189BC8BFE0b50D561A
export AWS_SECRET_ACCESS_KEY=56FDD9520ACD4D9DA835A6E36f783903
export AWS_ACCESS_KEY_ID=49585217C06847189AC8BFE0b50D561A
# create the following configuration file for this profile example
cat ~/.aws/s3cmd/$aws_profile.s3cfg
[my-profile]
access_key = 9521eed34b454e4f9f6a671550669447
secret_key = 0f0a9c873afe42c68101cd70bd58cfdc
host_base = es-si-s3-z2.ecloud.comm.net:10028
host_bucket = %(bucket)s.es-si-s3-z2.ecloud.comm.net:10028
human_readable_sizes = True
multipart_chunk_size_mb = 512
signature_v2 = True
use_https = True
# once again those values were fake ...
# how-to list the files in the bucket recursively
s3cmd ls -r -c ~/.aws/s3cmd/$aws_profile.s3cfg s3://$bucket | less
# how-to upload a file-or-dir to the bucket
s3cmd -r -c ~/.aws/s3cmd/$aws_profile.s3cfg put --acl-public --guess-mime-type /path/to/local/file s3://$bucket/path/to/remote/obj-file-or-dir
# how-to download a file-or-dir-object from the remote s3 bucket
s3cmd -r -c ~/.aws/s3cmd/$aws_profile.s3cfg get s3://$bucket/path/to/remote/obj-file /path/to/local/file-or-dir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment