View | Details | Raw Unified | Return to bug 172110
Collapse All | Expand All

(-)files/502.pgsql.in (-9 / +10 lines)
Lines 19-32 Link Here
19
# daily_pgsql_backup_enable="foo bar db1 db2" # only do backup of a limited selection of databases
19
# daily_pgsql_backup_enable="foo bar db1 db2" # only do backup of a limited selection of databases
20
# daily_pgsql_vacuum_enable="YES" # do vacuum
20
# daily_pgsql_vacuum_enable="YES" # do vacuum
21
21
22
daily_pgsql_user=%%PG_USER%%
23
daily_pgsql_vacuum_args="-U ${daily_pgsql_user} -qaz"
24
daily_pgsql_pgdump_args="-U ${daily_pgsql_user} -bF c"
25
daily_pgsql_pgdumpall_globals_args="-U ${daily_pgsql_user}"
26
# backupdir is relative to ~pgsql home directory unless it begins with a slash:
27
daily_pgsql_backupdir="~${daily_pgsql_user}/backups"
28
daily_pgsql_savedays="7"
29
30
# If there is a global system configuration file, suck it in.
22
# If there is a global system configuration file, suck it in.
31
#
23
#
32
if [ -r /etc/defaults/periodic.conf ]
24
if [ -r /etc/defaults/periodic.conf ]
Lines 35-40 Link Here
35
    source_periodic_confs
27
    source_periodic_confs
36
fi
28
fi
37
29
30
daily_pgsql_user=${daily_pgsql_user:-"%%PG_USER%%"}
31
daily_pgsql_port=${daily_pgsql_port:-"5432"}
32
daily_pgsql_vacuum_args="-U ${daily_pgsql_user} -p ${daily_pgsql_port} -qaz"
33
daily_pgsql_pgdump_args="-U ${daily_pgsql_user} -p ${daily_pgsql_port} -bF c"
34
daily_pgsql_pgdumpall_globals_args="-U ${daily_pgsql_user} -p ${daily_pgsql_port}"
35
# backupdir is relative to ~pgsql home directory unless it begins with a slash:
36
daily_pgsql_backupdir="~${daily_pgsql_user}/backups"
37
daily_pgsql_savedays="7"
38
38
# allow '~´ in dir name
39
# allow '~´ in dir name
39
eval backupdir=${daily_pgsql_backupdir}
40
eval backupdir=${daily_pgsql_backupdir}
40
41
Lines 82-88 Link Here
82
83
83
case "$daily_pgsql_backup_enable" in
84
case "$daily_pgsql_backup_enable" in
84
    [Yy][Ee][Ss])
85
    [Yy][Ee][Ss])
85
	dbnames=`su -l %%PG_USER%% -c "umask 077; psql -q -t -A -d template1 -U %%PG_USER%% -c SELECT\ datname\ FROM\ pg_database\ WHERE\ datname!=\'template0\'"`
86
	dbnames=`su -l ${daily_pgsql_user} -c "umask 077; psql -U ${daily_pgsql_user} -p ${daily_pgsql_port} -q -t -A -d template1 -c SELECT\ datname\ FROM\ pg_database\ WHERE\ datname!=\'template0\'"`
86
	pgsql_backup $dbnames
87
	pgsql_backup $dbnames
87
	;;
88
	;;

Return to bug 172110