From 6414c4c23d3fac2012d1524f17c0aae5e5012935 Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 27 Jul 2002 02:47:12 +0000 Subject: [PATCH] vacuum pg databases daily --- FS/bin/freeside-daily | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/FS/bin/freeside-daily b/FS/bin/freeside-daily index e6f02df33..142b0c73a 100755 --- a/FS/bin/freeside-daily +++ b/FS/bin/freeside-daily @@ -4,7 +4,7 @@ use strict; use Fcntl qw(:flock); use Date::Parse; use Getopt::Std; -use FS::UID qw(adminsuidsetup); +use FS::UID qw(adminsuidsetup driver_name dbh); use FS::Record qw(qsearch qsearchs); use FS::cust_main; @@ -41,6 +41,13 @@ foreach $cust_main ( @cust_main ) { } +if ( driver_name eq 'Pg' ) { + foreach my $statement ( 'vacuum', 'vacuum analyze' ) { + my $sth = dbh->prepare($statement) or die dbh->errstr; + $sth->execute or die $sth->errstr; + } +} + # subroutines sub untaint_argv { -- 2.20.1