vacuum pg databases daily
authorivan <ivan>
Sat, 27 Jul 2002 02:47:12 +0000 (02:47 +0000)
committerivan <ivan>
Sat, 27 Jul 2002 02:47:12 +0000 (02:47 +0000)
FS/bin/freeside-daily

index e6f02df..142b0c7 100755 (executable)
@@ -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 {