Skip to content

Instantly share code, notes, and snippets.

@markcaudill
Created April 27, 2011 17:37
Show Gist options
  • Save markcaudill/944756 to your computer and use it in GitHub Desktop.
Save markcaudill/944756 to your computer and use it in GitHub Desktop.
#!/bin/env bash
TMPFILE=/tmp/`hostname`.databases.`date '+%Y-%m-%d'`.sql
TMPGZFILE=$TMPFILE.gz
mysqldump -u root --password='PASSWORD' \
--all-databases --add-drop-database \
> $TMPFILE
gzip $TMPFILE #This will make a file with the $TMPGZFILE filename.
s3cmd put $TMPGZFILE s3://YOURBUCKET/
rm -f $TMPFILE $TMPGZFILE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment