Project

General

Profile

« Previous | Next » 

Revision 8926

Added by Jing Tao over 9 years ago

Use a variable to replace the hard code.

View differences:

vacuum-db.sh
1 1
#!/bin/bash
2 2
#A script to vacuum the db.
3 3
#Usage: nohup ./
4
DB_VERSION=9.3
4 5
echo "start to vacuum the db at" >> /tmp/vacuumdb.out
5 6
echo `date` >> /tmp/vacuumdb.out
6
su - postgres /usr/lib/postgresql/9.3/bin/vacuumdb --all >> /tmp/vacuumdb.out 2> /tmp/vacuumdb.err < /dev/null
7
su - postgres  -c "/usr/lib/postgresql/$DB_VERSION/bin/vacuumdb --all >> /tmp/vacuumdb.out 2> /tmp/vacuumdb.err < /dev/null"
7 8
echo "end to vacuum the db at " >> /tmp/vacuumdb.out
8
echo `date` >>  /tmp/vacuumdb.out
9
echo `date` >>  /tmp/vacuumdb.out

Also available in: Unified diff