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.