bash scripts to interact with S3
I have written these scripts a few times at my past couple jobs using my memory and my stackoverflow answer. So, now thanks to Grokker, I am able to release these. Hopefully they will help someone who needs to manipulate S3 objects from bash.
All of the scripts take an AWSID and Secret as the first two arguments. Most of them then take a file and bucket as the next two.
- s3_get.sh - copy an object from S3 into a local file
- s3_put.sh - copy a local file into an S3 object
- s3_head.sh - get some information on an S3 object
- s3_delete.sh - remove an object from S3
- s3_list.sh - list the contents of an S3 bucket
- s3_make_public.sh - change the acl on an S3 object into 'public'
- s3_copy_bucket.sh - copy the objects from one S3 bucket into another, uses s3_get.sh and s3_put.sh to ensure large objects (>5GB) get copied
- s3_list_multipart_uploads.sh - list unfinished multipart uploads including the uploadid. Objects greater then 5GB require the use of AWS's multipart upload process
- s3_abort_multipart_upload.sh - abort any unfinished multipart upload