root/wifidogadmin/sql/backup_database.sh

Revision 479, 377 bytes (checked in by insultant, 8 months ago)

--

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.