On Tue, Apr 24, 2007 at 10:56:34AM +0200, Kern Sibbald wrote:
> Yes, I think it is a good idea too.  Can the report submitter or someone else 
> supply a patch?  If I can get something in the next week, this will go into 
> version 2.2.0, which is now entering a feature freeze.

Here is an (untested!) patch.

# HG changeset patch
# User John Goerzen <[EMAIL PROTECTED]>
# Date 1177422199 18000
# Node ID bf5207168f2ab659bdf04cb01a0a968d042eb5ba
# Parent  26972468d802cbf0e5ffbc762e0eca75289f8dbd
Initial implementation of make_catalog_backup.in taking a hostname
fixes deb#419885

diff -r 26972468d802 -r bf5207168f2a src/cats/make_catalog_backup.in
--- a/src/cats/make_catalog_backup.in   Mon Apr 23 13:41:26 2007 -0500
+++ b/src/cats/make_catalog_backup.in   Tue Apr 24 08:43:19 2007 -0500
@@ -8,6 +8,8 @@
 #  $2 is the user name with which to access the database
 #     (default = bacula).
 #  $3 is the password with which to access the database or "" if no password
+#     (default "")
+#  $4 is the host on which the database is located
 #     (default "")
 #
 #
@@ -24,14 +26,25 @@ else
     else
       MYSQLPASSWORD=""
     fi
-    ${BINDIR}/mysqldump -u $2$MYSQLPASSWORD -f --opt $1 >$1.sql
+    if test $# -gt 3; then
+      MYSQLHOST=" --host=$4"
+    else
+      MYSQLHOST=""
+    fi
+    ${BINDIR}/mysqldump -u $2$MYSQLPASSWORD$MYSQLHOST -f --opt $1 >$1.sql
   else                       
     if test xpostgresql = [EMAIL PROTECTED]@ ; then
       if test $# -gt 2; then
-       PGPASSWORD=$3
-       export PGPASSWORD
+        PGPASSWORD="$3"
+        export PGPASSWORD
       fi
-      exec ${BINDIR}/pg_dump -c -U $2 $1 >$1.sql
+      if test $# -gt 3; then
+        PGHOST=" --host=$4"
+      else
+        PGHOST=""
+      fi
+
+      exec ${BINDIR}/pg_dump -c $PGHOST -U $2 $1 >$1.sql
     else
       echo ".dump" | ${BINDIR}/sqlite3 $1.db >$1.sql
     fi

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Bacula-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to