Skip to content

Instantly share code, notes, and snippets.

@robhudson
Created March 8, 2011 18:02
Show Gist options
  • Save robhudson/860665 to your computer and use it in GitHub Desktop.
Save robhudson/860665 to your computer and use it in GitHub Desktop.
One-liner for cron to backup a Django project to S3 using dumpdata
# Assumptions:
#
# Assumes boto is installed which comes with the s3put command
#
# Assumes your S3 keys are in ~/.boto in the form:
#
# [Credentials]
# aws_access_key_id = XXX
# aws_secret_access_key = XXX
#
/path/to/python /path/to/project/manage.py dumpdata [app1 app2 ...] | gzip > /tmp/dump.json.gz && /path/to/s3put -b [bucket-name] /tmp/dump.json.gz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment