]> git.sur5r.net Git - bacula/bacula/commitdiff
Kern had a better idea:
authorDan Langille <dan@langille.org>
Mon, 20 Sep 2004 14:46:24 +0000 (14:46 +0000)
committerDan Langille <dan@langille.org>
Mon, 20 Sep 2004 14:46:24 +0000 (14:46 +0000)
- alter src/dird/bacula-dir.conf.in to pass database and user
- alter src/cats/make_catalog_backup.in so that the database name
  and user name come in as $1 and $2 respectively.

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1602 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/cats/make_catalog_backup.in
bacula/src/dird/bacula-dir.conf.in

index dbc4d5943571f41a4e90a869512e348f31ae0a48..05295ed0caf08f0a2f781258da09f4348eb198d0 100755 (executable)
@@ -1,17 +1,23 @@
 #!/bin/sh
 #
 # This script dumps your Bacula catalog in ASCII format
-#  It works for either MySQL or SQLite
+# It works for MySQL, SQLite, and PostgreSQL
+#
+#  $1 is the name of the database to be backed up and the name
+#     of the output file (default = bacula).
+#  $2 is the user name with which to access the database
+#     (default = bacula).
+#
 #
 cd @working_dir@
 rm -f bacula.sql
 if test xsqlite = x@DB_NAME@ ; then
-  echo ".dump" | @SQL_BINDIR@/sqlite bacula.db >bacula.sql
+  echo ".dump" | @SQL_BINDIR@/sqlite $1.db >$1.sql
 else
   if test xmysql = x@DB_NAME@ ; then
-    @SQL_BINDIR@/mysqldump -u bacula -f --opt bacula >bacula.sql
+    @SQL_BINDIR@/mysqldump -u $2 -f --opt $1 >$1.sql
   else
-    @SQL_BINDIR@/pg_dump -U bacula bacula >bacula.sql
+    @SQL_BINDIR@/pg_dump -U $2 $1 >$1.sql
   fi
 fi
 #
index bc0647923109843f9327bc623b0aff5d87eed1f3..3947a331340721c0e9bd1ee0371fb6e0d998b4b0 100644 (file)
@@ -54,7 +54,7 @@ Job {
   FileSet="Catalog"
   Schedule = "WeeklyCycleAfterBackup"
   # This creates an ASCII copy of the catalog
-  RunBeforeJob = "@scriptdir@/make_catalog_backup"
+  RunBeforeJob = "@scriptdir@/make_catalog_backup bacula bacula"
   # This deletes the copy of the catalog
   RunAfterJob  = "@scriptdir@/delete_catalog_backup"
   Write Bootstrap = "@working_dir@/BackupCatalog.bsr"