scripts/pgbackup
author Tomas Zeman <tomas@functionals.cz>
Thu, 19 Feb 2026 10:37:57 +0100
changeset 62 9444c538bb93
parent 23 5eaf174f21fa
permissions -rw-r--r--
screenrc: updated green color (a little bit darker)

#!/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