1 HELPERS="$HELPERS pgsql:postgresql_database_backup"
4 inputBox "$pgsql_title" "Specify a vserver name:"
6 pgsql_vsname="vsname = $REPLY"
10 formBegin "$pgsql_title: databases"
24 pgsql_databases="databases = "
26 [ "$i" != "" ] && pgsql_databases="$pgsql_databases $i"
33 pgsql_title="PostgreSQL action wizard"
36 booleanBox "$pgsql_title" "Do you want to operate on a vserver? If not, the host will be operated on."
37 [ $? = 0 ] && do_pgsql_vserver
40 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"
42 pgsql_backupdir="backupdir = $REPLY"
45 booleanBox "$pgsql_title" "Do you want to backup the whole cluster? If not, you'll be offered to choose the databases to backup."
47 pgsql_databases="databases = all"
53 booleanBox "$pgsql_title" "Do you want to compress the backups?"
55 pgsql_compress="compress = yes"
57 pgsql_compress="compress = no"
61 get_next_filename $configdirectory/20.pgsql
62 cat >> $next_filename <<EOF
63 ### backupninja PostgreSQL config file ###
65 # vsname = <vserver> (no default)
66 # what vserver to operate on, only used if vserver = yes in /etc/backupninja.conf
67 # if you do not specify a vsname the host will be operated on
68 # Note: if operating on a vserver, $VROOTDIR will be prepended to backupdir.
71 # backupdir = <dir> (default: /var/backups/postgres)
72 # where to dump the backups
75 # databases = < all | db1 db2 db3 > (default = all)
76 # which databases to backup. should either be the word 'all' or a
77 # space separated list of database names.
78 # Note: when using 'all', pg_dumpall is used instead of pg_dump, which means
79 # that cluster-wide data (such as users and groups) are saved.
82 # compress = < yes | no > (default = yes)
83 # if yes, compress the pg_dump/pg_dumpall output.
87 chmod 600 $next_filename