Frequently Asked Questions
How can I automatically clean up old backups in my S3 account?
One way to remove old backups from your S3 storage would be to create a quick script that deletes old entries and make sure it runs daily. If you are running on Linux, or some other Unix-like system, then you could use the following Bash script to do the trick, and set it up in the crontab to run daily.
These commands make use of the s3cmd command (http://s3tools.org/s3cmd). It assumes that $BUCKET is set to your S3 bucket name, $ACCOUNT and $PROJECT are set to your Repository Hosting account subdomain and project abbreviation, and $BACKUPS_KEEP is the number of recent backups to keep.
export NUM_BACKUPS=`s3cmd list $BUCKET:$ACCOUNT_$PROJECT_ | wc -l` for i in `s3cmd list $BUCKET:$ACCOUNT_$PROJECT_ | grep -v '\-\-' | \ sort -r | tail -n $(($NUM_BACKUPS - $BACKUPS_KEEP - 1))`; do s3cmd delete $BUCKET:$i done





