aboutsummaryrefslogtreecommitdiff
path: root/boca-1.5.1/doc/dump.sh
diff options
context:
space:
mode:
authorcassiopc <cassiopc@gmail.com>2012-08-31 09:02:27 +0000
committercassiopc <cassiopc@gmail.com>2012-08-31 09:02:27 +0000
commit2948fe8d6055f6dfe6289e64bce426b5e0bb552f (patch)
tree2cff8a28f2bcf1f21116b952738b5e683e11c193 /boca-1.5.1/doc/dump.sh
parent37d5a8f2b6ecf585f91c2f7c804145853f0ca1e9 (diff)
downloadboca-2948fe8d6055f6dfe6289e64bce426b5e0bb552f.tar.gz
boca-2948fe8d6055f6dfe6289e64bce426b5e0bb552f.zip
inclusion of dir 1.5.1 for boca
Diffstat (limited to 'boca-1.5.1/doc/dump.sh')
-rwxr-xr-xboca-1.5.1/doc/dump.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/boca-1.5.1/doc/dump.sh b/boca-1.5.1/doc/dump.sh
new file mode 100755
index 0000000..f3f3282
--- /dev/null
+++ b/boca-1.5.1/doc/dump.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+if [ "`id -u`" != "0" ]; then
+ echo "Must be run as root"
+ exit 1
+fi
+bocadir=/var/www/boca
+[ -r /etc/boca.conf ] && . /etc/boca.conf
+
+for i in pg_dump grep cut gzip date; do
+ if [ "`which $i`" == "" ]; then
+ echo "$i executable is not in the PATH. Aborting"
+ exit 1
+ fi
+done
+da=`date +%d%b%Y-%Hh%Mmin`
+echo "I will create the file `pwd`/bocadb.$da.tar.gz"
+f=$bocadir/src/private/conf.php
+[ -r $f ] || f=$bocadir/src/private/conf.php
+if [ -r $f ]; then
+ echo I believe the password is `grep "\$conf\[\"dbpass\"\]=" $bocadir/src/private/conf.php | cut -d'"' -f4`
+else
+ echo "The password can be found in private/conf.php of the boca directory"
+fi
+pg_dump -f bocadb.$da.tar -Ft -b -h 127.0.0.1 -U bocauser bocadb
+gzip -9 bocadb.$da.tar
+
+exit 0