Daniel Hiller

Software engineer greybeard with a history of 20+ years transforming ☕ into useful stuff for others.
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 2024-11-07. Built by dhiller using Atom (editor), Jekyll (site builder), OneDark vivid (syntax highlighting theme), Webjeda (related posts), Disqus (discussions), Github Pages (hosting), Cloudflare (DNS).