File: trafstats_maintenance

package info (click to toggle)
trafstats 0.4.20-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 296 kB
  • ctags: 110
  • sloc: cpp: 1,036; sh: 475; perl: 173; makefile: 98
file content (19 lines) | stat: -rwxr-xr-x 426 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh
#
# trafstats_maintenance: Clean up and maintain the database integrity
# 
# Run this once a day from cron, as postgres (or whoever has vacuum 
# permissions on trafstats)

[ -f /etc/trafstats/trafstats.conf ] || exit 0

. /etc/trafstats/trafstats.conf

echo -n "Running vacuum on the database..."
psql $DBNAME -c "VACUUM ANALYZE rawtraffic" >& /dev/null
if [ $? -eq 0 ] 
then
	echo "Done!"
else
	echo "Failed!"
fi