This is a simple set of bash scripts to access an on-premise IBM COS Solution with S3 Access Key Authentication. They are designed to run on any IBM COS appliance, but should on any Linux or UNIX-like environment.
After the first use of any of these scripts a file .env will be created in your current directory. This file will contain your Access Key ID and Secret Access Key. Storing these keys to an external file will allow you to use any of the scripts without having to reenter your keys. To use different keys, just delete the s.env file and enter the new keys when you run the script again.
- getS3 - script which will download a object from a bucket to a file
- listS3 - script which will list objects in bucket
- putS3 - script which will upload a file to a bucket
- rmS3 - script which will remove an object from a bucket
- files.sh - script which will create and remove ten (10) 100mb files on the local filesystem for use with the above scripts for testing purposes.
If you run each script without any arguments, you'll get a description of what arguments are needed for the script.
The following commands are required to run these scripts:
- base64
- bash
- curl
- grep
- openssl
- sed
- IBM Cloud Object Storage Appliances running 3.17.x.x
- Vault Mode
- Container Mode
- Debian GNU/Linux 11 (Bullseye)
These scripts will not work as-is on the following:
- AIX
- Mac OS 10.14.6
If you have any problems, I recommend the following troubleshooting steps (in order):
- Download the latest official release. Its possible what you've pulled or cloned is a set of non-working scripts. Releases should work.
- Verify that your local OS has all the required commands
- If the scripts run without any syntax errors or missing commands and your getting access key errors, the most likely caused by your specific version of openssl. I've discovered that openssl on Mac OS Mojave generates an incorrect signature which causes access key errors. If thats the case, your out of luck. I have not investigated that type of error any further than to discover it doesn't work. I recommend trying on a different OS.