Created
December 3, 2010 22:07
-
-
Save hotsyk/727636 to your computer and use it in GitHub Desktop.
Script to dump db and upload dump file to S3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
myfilename=$(date "+%Y-%m-%d_%H:%M") | |
pg_dump -U dbuser -w dbname | gzip > /var/www/dbbackups/dbname-$myfilename.dump.gz | |
/var/www/s3/s3-put -S -k <your-key> -s /var/www/dbbackups/secret.key -T /var/www/dbbackups/dbname-$myfilename.dump.gz /dbname-dbbackups/dbname/$myfilename-dbname.dump.gz | |
##you will need to get http://s3-bash.googlecode.com/files/s3-bash.0.02.tar.gz | |
##to ensure that secret file is 40 bytes, use | |
##echo -n your-secret-ket > secret.key |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment