A simple Python script for backing up a PostgreSQL database and uploading it to Amazon S3
Here’s a very simple Python script I currently use to create a compressed PostgreSQL database backup for my Django app. Since my database is very small and I don’t see it becoming big anytime soon, I create the backup locally and send a copy to Amazon S3.
To keep it very simple, I have it set to do hourly backups for 24 hours and daily backups for 1 year (365 days). For the hourly …