Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ The DBD::Pg Perl module must be installed for these scripts to work. This can b
perl -MCPAN -e "CPAN::Shell->force(qw(install DBD::Pg));"
```

You may be asked by CPAN for the path to `pg_config`. You must provide the path, usually it is something like `/usr/pgsql-9.2/bin/pg_config`. If you do not have the pg_config binary, you will probably need to install the postgresql devel package.

### ###
# Installation #
### ###
Expand Down
7 changes: 6 additions & 1 deletion script/funcs.pl
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,12 @@ sub backup_database{
sub vacuum{
unless($skip_vacuum){
echo("vacuumdb started...");
cmd("vacuumdb -a -z -U $db_user 2>&1");

my $vac_cmd = "vacuumdb -a -z";

my $cmd = "test `whoami` == '$db_user' && $vac_cmd 2>&1 || su $db_user -c \"$vac_cmd\" 2>&1";

cmd($cmd);
echo("vacuumdb finished.");
}else{
echo("Skipping vacuumdb...");
Expand Down