Upload to S3 via Shell Script Without Aws-Cli, Possible?

As the title says, is it possible to upload to S3 via shell script without aws-cli-tools?

If so, how?

What I'm trying to do is read from a txt file on S3 (which is public, so no authentication is required).

But I want to be able to overwrite whatever is in the file (which is just a number).

Thanks in advance,

Fadi

2

2 Answers

Yes you can! You basically emulate the api calls the SDK would do for you through standard linux cmd utils.

Look at:

and/or

5

I use s3cmd which is a command line tool written in Python.

It uses the (restful) web APIs.

  • s3cmd put --recursive
  • s3cmd sync

would be the interesting bits:

Synchronize a directory tree to S3

s3cmd sync LOCAL_DIR s3://BUCKET[/PREFIX] or s3://BUCKET[/PREFIX] LOCAL_DIR

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Elena Rostova

Elena Rostova

Lead Health, Wellness & Medical Journalist

Elena Rostova holds a Master's degree in Public Health Journalism. She covers groundbreaking medical research, holistic wellness trends, mental health awareness, and nutritional science.

Share this article
Twitter Facebook Pinterest