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