Daniel Hiller

Geek, programmer, father
I'm a software engineer with more than 20 years of work experience.
I strive to create software that is useful for people so they can do stuff that matters.

Git aliases continued
All posts
Use gpg-agent for svn password caching

Backup S3 buckets

2018-03-19

aws s3 bash 

Another oneliner to backup all s3 buckets to local file storage:

for bucket_name in $(aws s3api list-buckets | jq -r '.Buckets[].Name' | grep -v 'access-logging'); do \
    aws s3 sync "s3://$bucket_name/" "$sync_dir/$bucket_name/"; \
done

The last one is only necessary if you have a bucket that you need to ignore which in my case is the bucket configured for access logging.


Git aliases continued
All posts
Use gpg-agent for svn password caching

Creative Commons License This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. Last update on 2023-11-29. Built by dhiller using Atom (editor), Jekyll (site builder), OneDark vivid (syntax highlighting theme), Webjeda (related posts), Disqus (discussions), Github Pages (hosting), Cloudflare (DNS).