#!/bin/bash
MNTPNT="/backup"
+MOUNTIT=1
DSTDIR="/backup/mysql/"
DBNAME=phpgroupware
DBUSER=phpgroupware
DBPASS=phpgroupware
-mount -w -o remount $MNTPNT
+[ $MOUNTIT == 1 ] && mount -w -o remount $MNTPNT
/usr/bin/mysqldump --databases $DBNAME -u $DBUSER --password=$DBPASS -c > $DSTDIR/mysql_phpgw_backup.sql
ls -l $DSTDIR/mysql_phpgw_backup.sql
-mount -r -o remount $MNTPNT
+[ $MOUNTIT == 1 ] && mount -r -o remount $MNTPNT
###################################################
# Open a connection to the database
-$dbh=DBI->connect("dbi:mysql:dbname=$dbname;host=$dbhost;port=$dbport",$dbuser,$dbpass,{
+$dbh=DBI->connect("dbi:mysql:dbname=$dbname:host=$dbhost:port=$dbport",$dbuser,$dbpass,{
AutoCommit=>0,
PrintError=>0}) or print "Connect Failure:".$DBI::errstr."\n" and exit 2;
###################################################
# Open a connection to the database
-$dbh=DBI->connect("dbi:mysql:dbname=$dbname;host=$dbhost;port=$dbport",$dbuser,$dbpass,{
+$dbh=DBI->connect("dbi:mysql:dbname=$dbname:host=$dbhost:port=$dbport",$dbuser,$dbpass,{
AutoCommit=>0,
PrintError=>0}) or print "Connect Failure:".$DBI::errstr."\n" and exit 2;