Created
July 10, 2011 17:21
-
-
Save rtekie/1074723 to your computer and use it in GitHub Desktop.
Heroku database backup to development system - add to crontab
This file contains hidden or 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 | |
echo "Backup started" `date` | |
APPLICATION_DIR=YOUR_APP_DIRECTORY_GOES_HERE | |
BACKUP_DIR=YOUR_BACKUP_DIRECTORY_GOES_HERE | |
cd ${APPLICATION_DIR} | |
heroku pgbackups:capture --expire | |
URL=`heroku pgbackups:url` | |
URL=${URL//\"/} | |
echo $URL | |
curl -o $BACKUP_DIR`date +"db_dump_%Y%m%d%H"` ${URL} | |
echo "Backup completed" `date` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment