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.
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
Last update on 2025-07-03.
Built by dhiller
using
Atom (editor),
Jekyll (site builder),
OneDark vivid (syntax highlighting theme),
Webjeda (related posts),
Disqus (discussions),
Github Pages (hosting),
Cloudflare (DNS).