root/trunk/wifidog-auth/sql/backup_database.sh

Revision 1281, 377 bytes (checked in by benoitg, 1 year ago)
  • Added vacuum_last_resort_fix_backup_restore_database.sh. This is DANGEROUS, and should only be run when your neglected (or had problem with) your VACCUMs,
    your database has become slow as molases, and VACUUM FULL is not an option because your db has grown too big.
  • Property svn:executable set to *
Line 
1 #!/bin/bash
2 DATABASE_NAME="wifidog";
3 USERNAME="wifidog";
4 FILENAME=$1;
5
6 if [ -z $FILENAME ] ; then
7 echo "You must specify a filename as the first argument"
8 exit 1
9 fi
10
11 $cmd="pg_dump --blobs --file=$FILENAME --format=c -i -O -o -v --compress=3 -U $USERNAME $DATABASE_NAME"
12 echo $cmd
13 $cmd
14 retval=$?
15 if [[ $retval -ne 0 ]] ; then
16     echo "Unable to dump the database"
17     exit 1
18 fi
Note: See TracBrowser for help on using the browser.