-# Create the postgres dump files
-function pgdump_pre() {
- log "Creating pre-daily-cron-job backup of $PGDATABASE database..."
- pg_dump > $base/backup/dump_pre_$(date +%Y.%m.%d-%H:%M:%S)
-}
-
-function pgdump_post() {
- log "Creating post-daily-cron-job backup of $PGDATABASE database..."
- cd $base/backup
- POSTDUMP=$(date +%Y.%m.%d-%H:%M:%S)
- pg_dump > $base/backup/dump_$POSTDUMP
- #pg_dumpall --globals-only > $base/backup/dumpall_$POSTDUMP
- ln -sf $base/backup/dump_$POSTDUMP current
- #ln -sf $base/backup/dumpall_$POSTDUMP currentall
-}
-
-# Load the dak-dev projectb
-function pgdakdev() {
- # Make sure to unset any possible psql variables so we don't drop the wrong
- # f****** database by accident
- local PGDATABASE
- unset PGDATABASE
- local PGHOST
- unset PGHOST
- local PGPORT
- unset PGPORT
- local PGUSER
- unset PGUSER
- cd $base/backup
- echo "drop database projectb" | psql -p 5434 template1
- #cat currentall | psql -p 5433 template1
- createdb -p 5434 -T template1 projectb
- fgrep -v '\connect' current | psql -p 5434 projectb
-}
-