Skip to content

Instantly share code, notes, and snippets.

@JeremyGeros
Created March 3, 2013 23:52
Show Gist options
  • Save JeremyGeros/5078948 to your computer and use it in GitHub Desktop.
Save JeremyGeros/5078948 to your computer and use it in GitHub Desktop.
[default]
use_https = True
access_key = BLAHBLAHBLAH
secret_key = BLAHBLAHBLAH
#!/bin/bash
export BACKUP_FILE=govocab-production-`date +'%Y-%m-%d-%H:%M'`.sql.gz
mysqldump --single-transaction -u deploy -pPASSWORDGOESHERE DATABASENAMETODUMP | gzip - > /tmp/$BACKUP_FILE
s3cmd put /tmp/$BACKUP_FILE s3://S3BUCKETNAME/mysql/$BACKUP_FILE
rm /tmp/$BACKUP_FILE
This package: s3cmd
with a .s3cfg in home directory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment