scripts/pgbackup
author Tomas Zeman <tzeman@volny.cz>
Wed, 18 Dec 2013 09:20:53 +0100
changeset 39 1fc1aab8014b
parent 23 5eaf174f21fa
permissions -rw-r--r--
svn commit helper (displays diff); diff must be manually deleted before committing the changes

#!/bin/sh -e
# Creates full pgsql backup with symlinks to last and prev backup.

BACKUPDIR=/home/pgsql/backup
N=pg_dumpall-`date +%F`.bz2
F=$BACKUPDIR/$N

pg_dumpall | bzip2 > $F.tmp
mv $F.tmp $F
cd $BACKUPDIR
[ -L last ] && mv last prev
ln -sf $N last