scripts/pgbackup
author Tomas Zeman <tomas@functionals.cz>
Tue, 15 Dec 2020 09:22:21 +0100
changeset 60 4267602e8494
parent 23 5eaf174f21fa
permissions -rw-r--r--
fs2json: directory structure -> json object converter. E.g. to be used instead of erica / py-Couchapp (interaction with couchdb is left to the user).

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