S3 cli usage examples
Once install of aws client is in place and you have
- Access key
- Secret key
https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html
Have your user with keys;
After that you should be able to use
Make bucket (create)aws s3 mb s3://demo-bucket --endpoint-url=https://object.peakox.com
Remove bucketaws s3 rb s3://demo-bucket --endpoint-url=https://object.peakox.com
Option: –force
List stuffaws s3 ls --endpoint-url=https://object.peakox.com
aws s3 ls s3://demo-bucket --endpoint-url=https://object.peakox.com
aws s3 ls s3://demo-bucket --endpoint-url=https://object.peakox.com --recursive --human-readable --summarize
Copy stuff to and from bucketaws s3 cp s3://demo-bucket --endpoint-url=https://object.peakox.com
aws s3 cp s3://demo-bucket --endpoint-url=https://object.peakox.com --recursive
aws s3 cp s3://demo-bucket/ --endpoint-url=https://object.peakox.com
Same for mv, rm
Sync bucketsaws s3 sync s3://demo-bucket s3://backupbucket-new --endpoint-url=https://object.peakox.com
Can also do local folders
Config locations
~/.aws/config
~/.aws/credentials
How to use in your code
https://docs.aws.amazon.com/code-library/latest/ug/python_3_s3_code_examples.html