From 59fbf591a22b0e3e70f26b74ac0a720526bc2c97 Mon Sep 17 00:00:00 2001 From: Dan Langille Date: Mon, 20 Sep 2004 14:46:24 +0000 Subject: [PATCH] Kern had a better idea: - 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 | 14 ++++++++++---- bacula/src/dird/bacula-dir.conf.in | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/bacula/src/cats/make_catalog_backup.in b/bacula/src/cats/make_catalog_backup.in index dbc4d59435..05295ed0ca 100755 --- a/bacula/src/cats/make_catalog_backup.in +++ b/bacula/src/cats/make_catalog_backup.in @@ -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 # diff --git a/bacula/src/dird/bacula-dir.conf.in b/bacula/src/dird/bacula-dir.conf.in index bc06479231..3947a33134 100644 --- a/bacula/src/dird/bacula-dir.conf.in +++ b/bacula/src/dird/bacula-dir.conf.in @@ -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" -- 2.39.5