Fetching contributors…
Cannot retrieve contributors at this time
executable file 21 lines (15 sloc) 667 Bytes
# Best use case is to create a file "" in your project folder and then
# call the command with bash update_local_db
# Follow me: @jackkinsella
function LastBackupName () {
heroku pgbackups | tail -n 1 | cut -d" " -f 1
# This part assumes you have a low limit on no. of backups allowed
#heroku pgbackups:destroy $old_backup
heroku pgbackups:capture
curl $(heroku pgbackups:url $new_backup) > temporary_backup.dump
pg_restore --verbose --clean --no-acl --no-owner -h localhost -U joslink -d joslink_development temporary_backup.dump
#rm -f temporary_backup.dump