3 # Bacula(R) - The Network Backup Solution
5 # Copyright (C) 2000-2015 Kern Sibbald
7 # The original author of Bacula is Kern Sibbald, with contributions
8 # from many others, a complete list can be found in the file AUTHORS.
10 # You may use this file and others of this release according to the
11 # license defined in the LICENSE file, which includes the Affero General
12 # Public License, v3.0 ("AGPLv3") and some additional permissions and
13 # terms pursuant to its AGPLv3 Section 7.
15 # This notice must be preserved when any source code is
16 # conveyed and/or propagated.
18 # Bacula(R) is a registered trademark of Kern Sibbald.
20 # breload This shell script takes care of reloading the director after
21 # a backup of the configuration and a bacula-dir -t test
26 BACDIRCFG=@sysconfdir@
27 BACWORKDIR=@working_dir@
28 BACBKPDIR=$BACWORKDIR/bkp
33 if [ -x ${BACDIRBIN}/bacula-dir -a -r ${BACDIRCFG}/bacula-dir.conf ]; then
34 echo "Testing the $Bacula Director daemon configuration"
36 if [ $(whoami) != "$DIR_USER" ]; then
37 USER_OPT="-u $DIR_USER"
40 ${BACDIRBIN}/bacula-dir -t $USER_OPT -c ${BACDIRCFG}/bacula-dir.conf
44 if [ ! -d $BACBKPDIR ]; then
45 echo "Creating Backup configuration directory"
48 chown $DIR_USER $BACBKPDIR
50 if [ -d $BACDIRCFG/conf.d ]; then
51 CONFD=$BACDIRCFG/conf.d
53 if [ -d $BACBKPDIR ]; then
54 echo "Backup configuration"
55 tar cfz $BACBKPDIR/bacula-dir-conf.$(date +%s).tgz $BACDIRCFG/*conf $CONFD
57 echo reload | ${BACDIRBIN}/bconsole >/dev/null
58 echo "Reloading configuration"
60 echo "Can't reload configuration, please correct errors first"