booleanBox "$pgsql_title" "Do you want to operate on a vserver? If not, the host will be operated on."
[ $? = 0 ] && do_pgsql_vserver
# backupdir
inputBox "$pgsql_title" "Directory where to store the backups:`[ -z \"$pgsql_vsname\" ] || echo \"\n(In respect to chosen vserver's root directory)\"`" "/var/backups/postgres"
[ $? = 1 ] && return
pgsql_backupdir="backupdir = $REPLY"
# databases
booleanBox "$pgsql_title" "Do you want to backup the whole cluster? If not, you'll be offered to choose the databases to backup."
if [ $? = 0 ]; then
pgsql_databases="databases = all"
else
do_pgsql_databases
fi
# compress
booleanBox "$pgsql_title" "Do you want to compress the backups?"
if [ $? = 0 ]; then
pgsql_compress="compress = yes"
else
pgsql_compress="compress = no"
fi
# write config file
get_next_filename $configdirectory/20.pgsql
cat >> $next_filename <<EOF
### backupninja PostgreSQL config file ###
# vsname = <vserver> (no default)
# what vserver to operate on, only used if vserver = yes in /etc/backupninja.conf
# if you do not specify a vsname the host will be operated on
# Note: if operating on a vserver, $VROOTDIR will be prepended to backupdir.