Author: nunofsantos
Date: 2009-02-24 17:29:46 -0500 (Tue, 24 Feb 2009)
New Revision: 3131
Added:
mgmt/trunk/mint/bin/mint-vacuumdb
mgmt/trunk/mint/etc/
mgmt/trunk/mint/etc/mint-vacuum.cron
Log:
add scripts for crontab-managed postgresql vacuuming
Added: mgmt/trunk/mint/bin/mint-vacuumdb
===================================================================
--- mgmt/trunk/mint/bin/mint-vacuumdb (rev 0)
+++ mgmt/trunk/mint/bin/mint-vacuumdb 2009-02-24 22:29:46 UTC (rev 3131)
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+TABLES="slot slot_stats job job_stats sysimage sysimage_stats"
+
+if [ "$1" == "full" ]; then
+ /usr/bin/vacuumdb --dbname=cumin --analyze --echo --verbose --host=localhost
--username=cumin
+elif [ "$1" == "tables" ]; then
+ for t in $TABLES ; do
+ /usr/bin/vacuumdb --dbname=cumin --table="$t" --analyze --echo --verbose
--host=localhost --username=cumin;
+ done
+else
+ echo "Usage: mint-vacuumdb [full | tables]"
+ echo " full = performs a database-wide vacuum/analyze"
+ echo " tables = performs a vacuum/analyze on a few pre-selected tables"
+fi
Property changes on: mgmt/trunk/mint/bin/mint-vacuumdb
___________________________________________________________________
Name: svn:executable
+ *
Added: mgmt/trunk/mint/etc/mint-vacuum.cron
===================================================================
--- mgmt/trunk/mint/etc/mint-vacuum.cron (rev 0)
+++ mgmt/trunk/mint/etc/mint-vacuum.cron 2009-02-24 22:29:46 UTC (rev 3131)
@@ -0,0 +1,4 @@
+# run database-wide vacuum nightly
+0 2 * * * /usr/bin/mint-vacuumdb full >> /var/log/cumin/mint-vacuum.log
2>&1
+# run table-specific vacuum every 10 minutes
+*/10 * * * * /usr/bin/mint-vacuumdb tables >> /var/log/cumin/mint-vacuum.log
2>&1
Show replies by date