Skip to content

Instantly share code, notes, and snippets.

@skyler
Created December 20, 2012 19:00
Show Gist options
  • Select an option

  • Save skyler/4347755 to your computer and use it in GitHub Desktop.

Select an option

Save skyler/4347755 to your computer and use it in GitHub Desktop.
#!/bin/bash
S3_ACCESS_KEY=XXX
FILENAME=$(date +"coefficient_%Y_%m_%d.pg")
PATH=/home/skyler/
echo "dumping database..."
/usr/bin/pg_dump coefficient --file $PATH$FILENAME
echo "uploading backup to S3..."
/opt/s3-curl/s3curl.pl -id=coefficient --put=$PATH$FILENAME -- https://s3.amazonaws.com/coefficient_db_backups/$FILENAME
echo "backup done."""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment