Bacula: Difference between revisions

From CSLLabWiki
Jump to navigation Jump to search
No edit summary
 
(72 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<big><big> '''"It comes by night and sucks the vital essence from your computers." -Bacula Project''' </big></big>
<big> How perfect for Transylvania... muhahahaha! </big>
Bacula is an enterprise-class, open source, network backup solution. While its configuration and use may seem daunting to understand at first, its structure is very logical and easy to use and maintain once you understand the basics. Bacula is supported by a team of developers that also offer commercial support for the product which is in its third version.
Bacula is an enterprise-class, open source, network backup solution. While its configuration and use may seem daunting to understand at first, its structure is very logical and easy to use and maintain once you understand the basics. Bacula is supported by a team of developers that also offer commercial support for the product which is in its third version.


[http://www.bacula.org stuff]
[http://www.bacula.org Bacula's Website]
 
== Basics ==
 
Bacula consists of 3 basic daemons and thus 3 config files:
# bacula-dir.conf - The director config.. the BIG config.. jobs, clients, schedules, etc (server only)
# bacula-sd.conf - The storage daemon config.. tape and/or disk drive config (server only)
# bacula-fd.conf - The file daemon config.. allows the director to backup the system (server + clients)
 
TBC..
 
== Server Installation ==
* This documentation is from the install of version 3.0.2 from sourcecode onto [http://kay.cs.transy.edu Kay] on Aug 21, 2009 by [mailto:chrismoore@csllama.net Chris Moore].
 
=== Download, Build, and Install Bacula ===
 
<code><pre>
 
mkdir /usr/local/bacula-src  # Where we will keep and build the source
mkdir /usr/local/bacula      # The installation directory (binaries, configs, etc)
cd /usr/local/bacula-src
 
wget http://downloads.sourceforge.net/project/bacula/bacula/3.0.2/bacula-3.0.2.tar.bz2
wget http://downloads.sourceforge.net/project/bacula/bacula/3.0.2/bacula-gui-3.0.2.tar.bz2
wget http://downloads.sourceforge.net/project/bacula/bacula/3.0.2/bacula-docs-3.0.2.tar.bz2
wget http://downloads.sourceforge.net/project/bacula/bacula/3.0.2/bacula-rescue-3.0.2.tar.bz2
 
tar -xvzf bacula-3.0.2.tar.bz2
tar -xvzf bacula-gui-3.0.2.tar.bz2
tar -xvjf bacula-docs-3.0.2.tar.bz2
tar -xvzf bacula-rescue-3.0.2.tar.bz2
 
cd ./bacula-3.0.2
 
yum install php httpd phpmyadmin php-mcrypt php-mbstring mysql mysql-devel mysql-server \
            qwtplot3d qwtplot3d-devel zlib-devel gccc gcc-c++ python-devel readline-devel
 
groupadd bacula -g 811
useradd bacula -u 811 -g 811 -d /usr/local/bacula -s /sbin/nologin
 
./configure --sbindir=/usr/local/bacula/bin \
            --sysconfdir=/usr/local/bacula \
            --enable-smartalloc \
            --with-qwt=/usr/lib/libqwt.so \
            --enable-batch-insert \
            --enable-tray-monitor \
            --enable-largefile \
            --enable-readline \
            --with-mysql \
            --with-openssl \
            --with-python \
            --with-working-dir=/usr/local/bacula \
            --with-dir-user=bacula \
            --with-dir-group=bacula \
            --with-sd-user=bacula \
            --with-sd-group=bacula \
            --with-fd-user=root \
            --with-fd-group=root
 
Output:
 
Configuration on Sat Aug 22 04:38:27 EDT 2009:
 
  Host:                    x86_64-unknown-linux-gnu -- redhat
  Bacula version:          Bacula 3.0.2 (18 July 2009)
  Source code location:    .
  Install binaries:        /usr/local/bacula/bin
  Install libraries:      /usr/lib
  Install config files:    /usr/local/bacula
  Scripts directory:      /usr/local/bacula
  Archive directory:      /tmp
  Working directory:      /usr/local/bacula
  PID directory:          /var/run
  Subsys directory:        /var/lock/subsys
  Man directory:          ${datarootdir}/man
  Data directory:          /usr/share
  Plugin directory:        /usr/lib
  C Compiler:              gcc 4.1.2
  C++ Compiler:            /usr/bin/g++ 4.1.2
  Compiler flags:          -g -O2 -Wall -fno-strict-aliasing -fno-exceptions -fno-rtti
  Linker flags:
  Libraries:              -lpthread -ldl
  Statically Linked Tools: no
  Statically Linked FD:    no
  Statically Linked SD:    no
  Statically Linked DIR:  no
  Statically Linked CONS:  no
  Database type:          MySQL
  Database port:
  Database lib:            -L/usr/lib64/mysql -lmysqlclient_r -lz
  Database name:          bacula
  Database user:          bacula
 
  Job Output Email:        root@localhost
  Traceback Email:        root@localhost
  SMTP Host Address:      localhost
 
  Director Port:          9101
  File daemon Port:        9102
  Storage daemon Port:    9103
 
  Director User:          bacula
  Director Group:          bacula
  Storage Daemon User:    bacula
  Storage DaemonGroup:    bacula
  File Daemon User:        root
  File Daemon Group:      root
 
  SQL binaries Directory  /usr/bin
 
  Large file support:      yes
  Bacula conio support:    yes -ltermcap
  readline support:        no
  TCP Wrappers support:    no
  TLS support:            yes
  Encryption support:      yes
  ZLIB support:            yes
  enable-smartalloc:      yes
  enable-lockmgr:          no
  bat support:            no
  enable-gnome:            no
  enable-bwx-console:      no
  enable-tray-monitor:    yes
  client-only:            no
  build-dird:              yes
  build-stored:            yes
  ACL support:            no
  XATTR support:          yes
  Python support:          yes -L/usr/lib64/python2.4/config -lpython2.4 -lutil -lrt
  Batch insert enabled:    yes
 
 
make all
make install
 
chown -R bacula.bacula /usr/local/bacula
 
</pre> </code>
 
=== Install Init Scripts and Set PATH ===
<code> <pre>
cd /usr/local/bacula-src/bacula-3.0.2/platforms/redhat
 
chmod +x bacula-dir
chmod +x bacula-sd
chmod +x bacula-fd
 
cp bacula-dir /etc/init.d
cp bacula-sd /etc/init.d
cp bacula-fd /etc/init.d
 
chkconfig --add bacula-dir
chkconfig --add bacula-sd
chkconfig --add bacula-fd
chkconfig mysqld on
chkconfig httpd on
</pre></code>
 
* Edit /etc/profile
** Add "pathmunge /usr/local/bacula/bin/" under UID 0's (root's) path changes
<code> <pre>
# Path manipulation
if [ "$EUID" = "0" ]; then
        pathmunge /sbin
        pathmunge /usr/sbin
        pathmunge /usr/local/sbin
        pathmunge /usr/local/bacula/bin
 
</pre> </code>
 
=== Configure Firewall, Apache, phpmyadmin ===
* Firewall
** Run system-config-securitylevel-tui
** Select "Customize" button
** Enable "WWW (HTTP)" and "Secure WWW (HTTPS)"
** Add "tcp:9101,udp:9101" to "Other ports"
** Select "OK" twice to exit
 
* Apache
** edit /etc/httpd/conf/httpd.conf
*** set "ServerName kay.cs.transy.edu"
 
* phpmyadmin
** edit /usr/share/phpmyadmin/config.inc.php
*** Fill in random characters for 'blowfish_secret'
** edit /etc/httpd/conf.d/phpmyadmin.conf
*** add "Allow from 10." below "Allow from 127.0.0.1"
 
* Restart Apache
** /etc/init.d/httpd restart
 
 
=== Configuring MySQL Database ===
* /etc/init.d/mysqld start
** Follow on-screen instructions to set root password for MySQL
** Test logging into database: mysql -u root --password (quit to exit)
 
* Browse to [http://kay.cs.transy.edu/phpmyadmin kay.cs.transy.edu/phpmyadmin]
* Login as 'root'
* Click 'Priviledges'
* Click 'Add new user'
** Username: bacula
** Host: localhost
** Password: bacula
** Select "Create database with same name and grant all privileges"
* Click 'Go'
 
* cd /usr/local/bacula
* Edit 'make_mysql_tables'
** Add "-u bacula --password" to allow login to mysql
*** 8th line should read: "if $bindir/mysql -u bacula --password $* -f <<END-OF-DATA"
* Run ./make_mysql_tables
* Edit 'bacula-dir.conf'
** Under "Catalog {" set dbpassword = "bacula"
 
=== Basic Bacula Configuration ===
* cd /usr/local/bacula
* mkdir orginal_confs
* cp *.conf original_confs/
 
* Replace bacula-dir.conf with:
<code> <pre>
 
### B A C U L A  at KAY.CS.TRANSY.EDU ################################################################################
# For Bacula release 3.0.2 (18 July 2009) -- redhat
# Bacula Director Config File
# ____________________________________________________________________________________________________________________
# ###<<<<< EDIT HISTORY >>>>>###
# 08/22/09 - CLM - Stripped unecessary defaults and reorganized
#
#
 
 
### DIRECTOR/CATALOG/CONSOLE ##########################################################################################
Director {                            # define myself
  Name = kay.cs.transy.edu-dir
  DIRport = 9101                # where we listen for UA connections
  QueryFile = "/usr/local/bacula/query.sql"
  WorkingDirectory = "/usr/local/bacula"
  PidDirectory = "/var/run"
  Maximum Concurrent Jobs = 1
  Password = "h1MOeZFbaD5Yf++iWp0WjtZ2SDr2X3aSoHENNM2V8oe5"        # Console password
  Messages = Daemon
}
 
Catalog {
  Name = MyCatalog
  dbname = "bacula"; dbuser = "bacula"; dbpassword = "bacula"
}
 
Console {
  Name = kay.cs.transy.edu-mon
  Password = "eGlf6NJdgKyJiZdUWVAEbdtEEyVJ3vKUVsRKYBsZIgn1"
  CommandACL = status, .status
}
 
### STORAGE ##########################################################################################################
Storage {
  Name = File
  Address = kay                # N.B. Use a fully qualified name here
  SDPort = 9103
  Password = "li1Mzezq64b7Ece79JTrEJFVKYuvm1yKr8WDx70sjc7k"
  Device = FileStorage
  Media Type = File
}
### /STORAGE #########################################################################################################
 
### MESSAGING ########################################################################################################
Messages {
  Name = Standard
  mailcommand = "/usr/local/bacula/bin/bsmtp -h localhost -f \"\(Bacula\) \<%r\>\" -s \"Bacula: %t %e of %c %l\" %r"
  operatorcommand = "/usr/local/bacula/bin/bsmtp -h localhost -f \"\(Bacula\) \<%r\>\" -s \"Bacula: Intervention needed for %j\" %r"
  mail = root@localhost = all, !skipped
  operator = root@localhost = mount
  console = all, !skipped, !saved
  append = "/usr/local/bacula/log" = all, !skipped
  catalog = all
}
 
Messages {
  Name = Daemon
  mailcommand = "/usr/local/bacula/bin/bsmtp -h localhost -f \"\(Bacula\) \<%r\>\" -s \"Bacula daemon message\" %r"
  mail = root@localhost = all, !skipped
  console = all, !skipped, !saved
  append = "/usr/local/bacula/log" = all, !skipped
}
### /MESSAGING ######################################################################################################
 
#####################################################################################################################
#####################################################################################################################
#####################################################################################################################
 
### CLIENTS #########################################################################################################
Client {
  Name = kay.cs.transy.edu-fd
  Address = kay
  FDPort = 9102
  Catalog = MyCatalog
  Password = "9xNhJRzsiqGJeE5J2jd9xFNKk0TkZBEt7l9b1loMHlFr"          # password for FileDaemon
  File Retention = 30 days            # 30 days
  Job Retention = 6 months            # six months
  AutoPrune = yes                    # Prune expired Jobs/Files
}
### /CLIENTS ########################################################################################################
 
### SCHEDULES #######################################################################################################
Schedule {
  Name = "WeeklyCycleAfterBackup"
  Run = Full sun-sat at 23:10
}
### /SCHEDULES ######################################################################################################
 
### FILESETS ########################################################################################################
FileSet {
  Name = "Catalog"
  Include {
    Options {
      signature = MD5
    }
    File = /usr/local/bacula/bacula.sql
  }
}
### /FILESETS ######################################################################################################
 
### POOLS ##########################################################################################################
Pool {
  Name = Default
  Pool Type = Backup
  Recycle = yes                      # Bacula can automatically recycle Volumes
  AutoPrune = yes                    # Prune expired volumes
  Volume Retention = 365 days        # one year
}
 
### /POOLS #########################################################################################################
 
### JOBS ###########################################################################################################
 
JobDefs {
  Name = "DefaultJob"
  Type = Backup
  Level = Incremental
  Client = kay.cs.transy.edu-fd
  FileSet = "Catalog"
  Schedule = "WeeklyCycleAfterBackup"
  Storage = File
  Messages = Standard
  Pool = Default
  Priority = 10
}
 
Job {
  Name = "BackupClient1"
  JobDefs = "DefaultJob"
  Write Bootstrap = "/usr/local/bacula/Client1.bsr"
}
 
### /JOBS ##########################################################################################################
 
 
</pre> </code>
 
* Replace bacula-sd.conf with:
 
<code> <pre>
 
 
### B A C U L A  at KAY.CS.TRANSY.EDU ################################################################################
# For Bacula release 3.0.2 (18 July 2009) -- redhat
# Bacula Storage Daemon Config File
# ____________________________________________________________________________________________________________________
# ###<<<<< EDIT HISTORY >>>>>###
# 08/22/09 - CLM - Stripped unecessary defaults and reorganized
#
#
 
Storage {                            # definition of myself
  Name = kay.cs.transy.edu-sd
  SDPort = 9103                  # Director's port
  WorkingDirectory = "/usr/local/bacula"
  Pid Directory = "/var/run"
  Maximum Concurrent Jobs = 20
}
 
Director {
  Name = kay.cs.transy.edu-dir
  Password = "li1Mzezq64b7Ece79JTrEJFVKYuvm1yKr8WDx70sjc7k"
}
 
Director {
  Name = kay.cs.transy.edu-mon
  Password = "WksLFW7L2zpv4A+FFAwI3bQujzKKy2WpEcpParM0vdQw"
  Monitor = yes
}
 
Device {
  Name = FileStorage
  Media Type = File
  Archive Device = /tmp
  LabelMedia = yes;                  # lets Bacula label unlabeled media
  Random Access = Yes;
  AutomaticMount = yes;              # when device opened, read it
  RemovableMedia = no;
  AlwaysOpen = no;
}
 
Messages {
  Name = Standard
  director = kay.cs.transy.edu-dir = all
}
 
</pre> </code>
 
* Replace bacula-fd.conf with:
 
<code> <pre>
 
### B A C U L A  at KAY.CS.TRANSY.EDU ################################################################################
# For Bacula release 3.0.2 (18 July 2009) -- redhat
# Bacula File Daemon Config File
# ____________________________________________________________________________________________________________________
# ###<<<<< EDIT HISTORY >>>>>###
# 08/22/09 - CLM - Stripped unecessary defaults and reorganized
#
#
 
Director {
  Name = kay.cs.transy.edu-dir
  Password = "9xNhJRzsiqGJeE5J2jd9xFNKk0TkZBEt7l9b1loMHlFr"
}
 
Director {
  Name = kay.cs.transy.edu-mon
  Password = "Isi5abNFrjx4LNFvt23R/Z0N2ojcwTfeeWG62e+7O4ZC"
  Monitor = yes
}
 
FileDaemon {                          # this is me
  Name = kay.cs.transy.edu-fd
  FDport = 9102                  # where we listen for the director
  WorkingDirectory = /usr/local/bacula
  Pid Directory = /var/run
  Maximum Concurrent Jobs = 20
}
 
Messages {
  Name = Standard
  director = kay.cs.transy.edu-dir = all, !skipped, !restored
}
 
 
</pre> </code>
 
=== Web GUI Install (bweb) ===
 
* Bweb is a Perl based web front-end to Bacula. Great for reporting and checking logs, though I wouldn't recommend using it to interface with the Bacula directore - use [[bconsole]].
 
<code> <pre>
yum install perl-Date-Calc perl-Expect perl-HTML-Template perl-GD perl-GD-Graph perl-Time-ParseDate
*NOTE*: Perl's Time::ParseDate module is required but isn't available via 'yum' at this time. Might have to use cpan.
 
cd /usr/local/bacula-src/bacula-gui-3.0.2/bweb
</pre> </code>
 
* Edit 'install_bweb'
** Set CONF_DIR=/usr/local/bacula
** Set WEB_DIR=/var/www/html
** Set CGI_BIN=/var/www/cgi-bin
** Set HTTP_USER=apache
** Set HTTP_GROUP=apache
** Set DB_PW="bacula"
 
* Run "./bweb_install"
* Run "mysql bacula -u bacula --password < script/bweb-mysql.sql"
* Run "mkdir /var/spool/bweb"
* Run "chown apache.apache /var/spool/bweb"
 
* Browse to http://kay.cs.transy.edu/bweb. No data should be present as the daemons aren't running, but the page should render without data.
** Select "Configuration" from top menu and set the following fields:
*** fv_write_path = /var/spool/bweb
*** bconsole = /usr/local/bacula/bin/bconsole -n -c /usr/local/bacula/bconsole.conf
*** wiki_url = http://www.cs.transy.edu/wiki
** Click "Save"
** Select and delete the default "autochanger"
 
* To secure access to Bweb..
** Run "htpasswd -c /etc/httpd/passwords root"
*** Set root password
** Save the following to /etc/httpd/conf.d/bweb.conf:
 
<code> <pre>
 
#  Web application to manage Bacula
#
 
<Directory "/var/www/html/bweb">
  Order Deny,Allow
  Deny from all
  Allow from 127.0.0.1
  Allow from 10.
 
  AuthType Basic
  AuthName "Bacula's Bweb Interface"
  AuthUserFile /etc/httpd/passwords
  Require user root
</Directory>
 
<Directory "/var/www/cgi-bin/bweb">
  Order Deny,Allow
  Deny from all
  Allow from 127.0.0.1
  Allow from 10.
 
  AuthType Basic
  AuthName "Bacula's Bweb Interface"
  AuthUserFile /etc/httpd/passwords
  Require user root
</Directory>
 
</pre> </code>
 
=== First Run ===
* As root, run "bacula start", you shouldn't get any errors.
* Now launch the console interface to Bacula by running "bconsole"
** Type "quit" to exit
 
 
== Bacula Configuration ==
 
=== Clients ===
 
=== Pools ===
 
 
=== Schedules ===
 
 
=== Filesets ===
 
=== Jobs ===
 
=== Full Example: bacula-dir.conf ===
 
<code> <pre>
### B A C U L A  at KAY.CS.TRANSY.EDU ################################################################################
# For Bacula release 3.0.2 (18 July 2009) -- redhat
# Bacula Director Config File
# ____________________________________________________________________________________________________________________
# ###<<<<< EDIT HISTORY >>>>>###
# 08/22/09 - CLM - Stripped unecessary defaults and reorganized
# 08/26/09 - CLM - Full configuration for backup of servers and NFS data
#
 
 
### DIRECTOR/CATALOG/CONSOLE ##########################################################################################
Director {                            # define myself
  Name = kay.cs.transy.edu-dir
  DIRport = 9101                # where we listen for UA connections
  QueryFile = "/usr/local/bacula/query.sql"
  WorkingDirectory = "/usr/local/bacula"
  PidDirectory = "/var/run"
  Maximum Concurrent Jobs = 1
  Password = "h1MOeZFbaD5Yf++iWp0WjtZ2SDr2X3aSoHENNM2V8oe5"        # Console password
  Messages = Daemon
}
 
Catalog {
  Name = MyCatalog
  dbname = "bacula"; dbuser = "bacula"; dbpassword = "bacula"
}
 
Console {
  Name = kay.cs.transy.edu-mon
  Password = "eGlf6NJdgKyJiZdUWVAEbdtEEyVJ3vKUVsRKYBsZIgn1"
  CommandACL = status, .status
}
 
### STORAGE ##########################################################################################################
Storage {
  Name = File
  Address = kay                # N.B. Use a fully qualified name here
  SDPort = 9103
  Password = "li1Mzezq64b7Ece79JTrEJFVKYuvm1yKr8WDx70sjc7k"
  Device = FileStorage
  Media Type = File
}
### /STORAGE #########################################################################################################
 
### MESSAGING ########################################################################################################
Messages {
  Name = Standard
  mailcommand = "/usr/local/bacula/bin/bsmtp -h localhost -f \"\(Bacula\) \<%r\>\" -s \"Bacula: %t %e of %c %l\" %r"
  operatorcommand = "/usr/local/bacula/bin/bsmtp -h localhost -f \"\(Bacula\) \<%r\>\" -s \"Bacula: Intervention needed for %j\" %r"
  mail = root@localhost = all, !skipped
  operator = root@localhost = mount
  console = all, !skipped, !saved
  append = "/usr/local/bacula/log" = all, !skipped
  catalog = all
}
 
Messages {
  Name = Daemon
  mailcommand = "/usr/local/bacula/bin/bsmtp -h localhost -f \"\(Bacula\) \<%r\>\" -s \"Bacula daemon message\" %r"
  mail = root@localhost = all, !skipped
  console = all, !skipped, !saved
  append = "/usr/local/bacula/log" = all, !skipped
}
### /MESSAGING ######################################################################################################
 
#####################################################################################################################
#####################################################################################################################
#####################################################################################################################
 
### CLIENTS #########################################################################################################
Client {
  Name = kay.cs.transy.edu-fd
  Address = kay
  FDPort = 9102
  Catalog = MyCatalog
  Password = "9xNhJRzsiqGJeE5J2jd9xFNKk0TkZBEt7l9b1loMHlFr"          # password for FileDaemon
  File Retention = 30 days            # 30 days
  Job Retention = 6 months            # six months
  AutoPrune = yes                    # Prune expired Jobs/Files
}
 
Client {
  Name = babbage.cs.transy.edu-fd
  Address = babbage
  FDPort = 9102
  Catalog = MyCatalog
  Password = "3nFuu73Anv82Idnaypwoo38mzdAdnfEWH278AnE2ljBd"          # password for FileDaemon
  File Retention = 30 days            # 30 days
  Job Retention = 6 months            # six months
  AutoPrune = yes                    # Prune expired Jobs/Files
}
 
Client {
  Name = hollerith.cs.transy.edu-fd
  Address = hollerith
  FDPort = 9102
  Catalog = MyCatalog
  Password = "nm38sFNANDE82h1648FApoeppAbdg23bajy1i49BDY3h"          # password for FileDaemon
  File Retention = 30 days            # 30 days
  Job Retention = 6 months            # six months
  AutoPrune = yes                    # Prune expired Jobs/Files
}
### /CLIENTS ########################################################################################################
 
### SCHEDULES #######################################################################################################
Schedule {
  Name = "Classes"
  Run = Level=Incremental Pool=Nightly-Inc-Classes mon-sat at 1:00
  Run = Level=Full Pool=Weekly-Full-Classes sun at 1:00
}
 
Schedule {
  Name = "Homedirs"
  Run = Level=Incremental Pool=Nightly-Inc-Homedirs mon-sat at 4:00
  Run = Level=Full Pool=Weekly-Full-Homedirs sun at 4:00
}
 
Schedule {
  Name = "Babbage"
  Run = Level=Incremental Pool=Nightly-Inc-Babbage mon-sat at 1:30
  Run = Level=Full Pool=Weekly-Full-Babbage sun at 1:30
}
 
Schedule {
  Name = "Hollerith"
  Run = Level=Incremental Pool=Nightly-Inc-Hollerith mon-sat at 2:00
  Run = Level=Full Pool=Weekly-Full-Hollerith sun at 2:00
}
 
Schedule {
  Name = "OtherExportfs"
  Run = Level=Full Pool=Weekly-Full-OtherExportfs sun at 2:30
}
 
Schedule {
  Name = "Catalog"
  Run = Level=Full Pool=Nightly-Full-Catalog at 8:00
}
 
### /SCHEDULES ######################################################################################################
 
### FILESETS ########################################################################################################
FileSet {
  # For client Kay
  Name = "Catalog"
  Include {
    Options {
      Signature = MD5
      Compression = GZIP
    }
    File = /usr/local/bacula/bacula.sql
  }
}
 
FileSet {
  # For client Babbage
  Name = "Classes"
  Include {
    Options {
      Signature = MD5
      Compression = GZIP
      Recurse = Yes
    }
    File = /mnt/data/exportfs/classes
  }
}
 
FileSet {
  # For client Babbage
  Name = "Homedirs"
  Include {
    Options {
      Signature = MD5
      Compression = GZIP
      Recurse = Yes
      Exclude = yes
      IgnoreCase = yes
 
      # Exclude browser cache
      WildDir = "/mnt/data/exportfs/home/*/.mozilla/firefox/*/Cache"
      WildDir = "/mnt/data/exportfs/home/*/.netscape/*/Cache"
 
    }
    File = /mnt/data/exportfs/home
  }
}
 
FileSet {
  # For client Hollerith
  Name = "Hollerith"
  Include {
    Options {
      Signature = MD5
      Recurse = Yes
      Compression = GZIP
    }
    File = /home/www
    File = /var/www
    File = /etc
    File = /var/mysqlBackup.sql
  }
}
 
FileSet {
  # For client Babbage
  Name = "Babbage"
  Include {
    Options {
      Signature = MD5
      Recurse = Yes
      Compression = GZIP
    }
    File = /etc
    File = /var/mysqlBackup.sql
  }
}
 
FileSet {
  # For client Babbage
  Name = "OtherExportfs"
  Include {
    Options {
      Signature = MD5
      Recurse = Yes
      Compression = GZIP
    }
    File = /mnt/data/exportfs/usrlocal65
    File = /mnt/data/exportfs/usrlocalmac
    File = /mnt/data/exportfs/usrlocalneko
    File = /mnt/data/exportfs/labdata
  }
}
 
### /FILESETS ######################################################################################################
 
### POOLS ##########################################################################################################
Pool {
  Name = Nightly-Inc-Classes
  Pool Type = Backup
  Storage = File
  Label Format = "Nightly-Inc-Classes-"
  Catalog Files = yes
  Recycle = yes
  AutoPrune = yes
  Volume Retention = 7 days
  Maximum Volume Jobs = 1
}
 
Pool {
  Name = Nightly-Inc-Homedirs
  Pool Type = Backup
  Storage = File
  Label Format = "Nightly-Inc-Homedirs-"
  Catalog Files = yes
  Recycle = yes
  AutoPrune = yes
  Volume Retention = 7 days
  Maximum Volume Jobs = 1
}
 
Pool {
  Name = Nightly-Inc-Babbage
  Pool Type = Backup
  Storage = File
  Label Format = "Nightly-Inc-Babbage-"
  Catalog Files = yes
  Recycle = yes
  AutoPrune = yes
  Volume Retention = 7 days
  Maximum Volume Jobs = 1
}
 
Pool {
  Name = Nightly-Inc-Hollerith
  Pool Type = Backup
  Storage = File
  Label Format = "Nightly-Inc-Hollerith-"
  Catalog Files = yes
  Recycle = yes
  AutoPrune = yes
  Volume Retention = 7 days
  Maximum Volume Jobs = 1
}
 
Pool {
  Name = Weekly-Full-Babbage
  Pool Type = Backup
  Storage = File
  Label Format = "Weekly-Full-Babbage-"
  Catalog Files = yes
  Recycle = yes
  AutoPrune = yes
  Volume Retention = 1 month
  Maximum Volume Jobs = 1
}
 
Pool {
  Name = Weekly-Full-Hollerith
  Pool Type = Backup
  Storage = File
  Label Format = "Weekly-Full-Hollerith-"
  Catalog Files = yes
  Recycle = yes
  AutoPrune = yes
  Volume Retention = 1 month
  Maximum Volume Jobs = 1
}
 
Pool {
  Name = Weekly-Full-Classes
  Pool Type = Backup
  Storage = File
  Label Format = "Weekly-Full-Classes-"
  Catalog Files = yes
  Recycle = yes
  AutoPrune = yes
  Volume Retention = 1 month
  Maximum Volume Jobs = 1
}
 
Pool {
  Name = Weekly-Full-Homedirs
  Pool Type = Backup
  Storage = File
  Label Format = "Weekly-Full-Homedirs-"
  Catalog Files = yes
  Recycle = yes
  AutoPrune = yes
  Volume Retention = 1 month
  Maximum Volume Jobs = 1
}
 
Pool {
  Name = Weekly-Full-OtherExportfs
  Pool Type = Backup
  Storage = File
  Label Format = "Weekly-Full-OtherExportfs-"
  Catalog Files = yes
  Recycle = yes
  AutoPrune = yes
  Volume Retention = 2 weeks
  Maximum Volume Jobs = 1
}
 
Pool {
  Name = Nightly-Full-Catalog
  Pool Type = Backup
  Storage = File
  Label Format = "Nightly-Full-Catalog-"
  Catalog Files = yes
  Recycle = yes
  AutoPrune = yes
  Volume Retention = 7 days
  Maximum Volume Jobs = 1
}
 
### /POOLS #########################################################################################################
 
### JOBS ###########################################################################################################
 
Job {
  Name = "Catalog"
  Type = Backup
  Level = Full
  FileSet="Catalog"
  Pool = "Nightly-Full-Catalog"
  Client = kay.cs.transy.edu-fd
  Schedule = "Catalog"
  Messages = Standard
  RunBeforeJob = "/usr/local/bacula/make_catalog_backup bacula bacula bacula" # AHHH! ;)
  RunAfterJob  = "/usr/local/bacula/delete_catalog_backup"
  Write Bootstrap = "/usr/local/bacula/BackupCatalog.bsr"
  Priority = 11                  # run after main backup
}
 
Job {
  Name = "Classes"
  Type = Backup
  FileSet = "Classes"
  Client = babbage.cs.transy.edu-fd
  Schedule = "Classes"
  Messages = Standard
 
  # Overidden by Schedule but useful as default for manual run
  Level = Full
  Pool = Weekly-Full-Classes
}
 
Job {
  Name = "Homedirs"
  Type = Backup
  FileSet = "Homedirs"
  Client = babbage.cs.transy.edu-fd
  Schedule = "Homedirs"
  Messages = Standard
 
  # Overidden by Schedule but useful as default for manual run
  Level = Full
  Pool = Weekly-Full-Homedirs
}
 
Job {
  Name = "Babbage"
  Type = Backup
  FileSet = "Babbage"
  Client = babbage.cs.transy.edu-fd
  Schedule = "Babbage"
  Messages = Standard
 
  # Overidden by Schedule but useful as default for manual run
  Level = Full
  Pool = Weekly-Full-Babbage
}
 
Job {
  Name = "Hollerith"
  Type = Backup
  FileSet = "Hollerith"
  Client = hollerith.cs.transy.edu-fd
  Schedule = "Hollerith"
  Messages = Standard
 
  # Overidden by Schedule but useful as default for manual run
  Level = Full
  Pool = Weekly-Full-Hollerith
}
 
Job {
  Name = "OtherExportfs"
  Type = Backup
  FileSet = "OtherExportfs"
  Client = babbage.cs.transy.edu-fd
  Schedule = "OtherExportfs"
  Messages = Standard
 
  # Overidden by Schedule but useful as default for manual run
  Level = Full
  Pool = Weekly-Full-OtherExportfs
}
 
# The "restore" job (necessary
Job {
Name = "Restore"
Type = Restore
Client = kay.cs.transy.edu-fd
Where = /mnt/data/bacula-restore/
Messages = Standard
 
# Meaningless but required
Pool = Weekly-Full-Homedirs
Fileset = "Homedirs"
}
 
### /JOBS ##########################################################################################################                                                                                       
</pre> </code>
 
== Client Installation ==
 
*RPMs:
[[File:Bacula-client-3.0.2-1.el5.x86_64.rpm]]
 
# Download the appropriate RPM above.
# As root, run "rpm -ivh Bacula-client-3.0.2-1.el5.x86_64.rpm"
# Edit /etc/bacula/bacula-fd.conf:
## The password under the first "Director" section should be randomly generated for each client. Make note of this password as it will need to be entered in the server's bacula-dir.conf config.
## The name under the "FileDaemon" should be changed to match the client's FQDN followed by "-fd".
<code> <pre>
 
### B A C U L A  at BABBAGE.CS.TRANSY.EDU ################################################################################
# For Bacula release 3.0.2 (18 July 2009) -- redhat
# Bacula File Daemon Config File
# ____________________________________________________________________________________________________________________
# ###<<<<< EDIT HISTORY >>>>>###
# 08/23/09 - CLM - Original config
#
#
 
Director {
  Name = kay.cs.transy.edu-dir
  Password = "3nFuu73Anv82Idnaypwoo38mzdAdnfEWH278AnE2ljBd"
}
 
Director {
  Name = kay.cs.transy.edu-mon
  Password = "Isi5abNFrjx4LNFvt23R/Z0N2ojcwTfeeWG62e+7O4ZC"
  Monitor = yes
}
 
FileDaemon {                          # this is me
  Name = babbage.cs.transy.edu-fd
  FDport = 9102                  # where we listen for the director
  WorkingDirectory = /var/lib/bacula
  Pid Directory = /var/run
  Maximum Concurrent Jobs = 20
}
 
Messages {
  Name = Standard
  director = kay.cs.transy.edu-dir = all, !skipped, !restored
}
 
</pre> </code>
 
# Use "system-config-securitylevel-tui" to open 9102:tcp,9102:udp
# Complete the client's configuration by adding the appropriate "Client {" section on the server's bacula-dir.conf

Latest revision as of 10:55, 26 August 2009

"It comes by night and sucks the vital essence from your computers." -Bacula Project

How perfect for Transylvania... muhahahaha!

Bacula is an enterprise-class, open source, network backup solution. While its configuration and use may seem daunting to understand at first, its structure is very logical and easy to use and maintain once you understand the basics. Bacula is supported by a team of developers that also offer commercial support for the product which is in its third version.

Bacula's Website

Basics[edit]

Bacula consists of 3 basic daemons and thus 3 config files:

  1. bacula-dir.conf - The director config.. the BIG config.. jobs, clients, schedules, etc (server only)
  2. bacula-sd.conf - The storage daemon config.. tape and/or disk drive config (server only)
  3. bacula-fd.conf - The file daemon config.. allows the director to backup the system (server + clients)

TBC..

Server Installation[edit]

  • This documentation is from the install of version 3.0.2 from sourcecode onto Kay on Aug 21, 2009 by Chris Moore.

Download, Build, and Install Bacula[edit]


mkdir /usr/local/bacula-src  # Where we will keep and build the source
mkdir /usr/local/bacula      # The installation directory (binaries, configs, etc)
cd /usr/local/bacula-src

wget http://downloads.sourceforge.net/project/bacula/bacula/3.0.2/bacula-3.0.2.tar.bz2
wget http://downloads.sourceforge.net/project/bacula/bacula/3.0.2/bacula-gui-3.0.2.tar.bz2
wget http://downloads.sourceforge.net/project/bacula/bacula/3.0.2/bacula-docs-3.0.2.tar.bz2
wget http://downloads.sourceforge.net/project/bacula/bacula/3.0.2/bacula-rescue-3.0.2.tar.bz2

tar -xvzf bacula-3.0.2.tar.bz2
tar -xvzf bacula-gui-3.0.2.tar.bz2
tar -xvjf bacula-docs-3.0.2.tar.bz2
tar -xvzf bacula-rescue-3.0.2.tar.bz2

cd ./bacula-3.0.2

yum install php httpd phpmyadmin php-mcrypt php-mbstring mysql mysql-devel mysql-server \
            qwtplot3d qwtplot3d-devel zlib-devel gccc gcc-c++ python-devel readline-devel

groupadd bacula -g 811
useradd bacula -u 811 -g 811 -d /usr/local/bacula -s /sbin/nologin

./configure --sbindir=/usr/local/bacula/bin \
            --sysconfdir=/usr/local/bacula \
            --enable-smartalloc \
            --with-qwt=/usr/lib/libqwt.so \
            --enable-batch-insert \
            --enable-tray-monitor \
            --enable-largefile \
            --enable-readline \
            --with-mysql \
            --with-openssl \
            --with-python \
            --with-working-dir=/usr/local/bacula \
            --with-dir-user=bacula \
            --with-dir-group=bacula \
            --with-sd-user=bacula \
            --with-sd-group=bacula \
            --with-fd-user=root \
            --with-fd-group=root

Output:

Configuration on Sat Aug 22 04:38:27 EDT 2009:

   Host:                    x86_64-unknown-linux-gnu -- redhat
   Bacula version:          Bacula 3.0.2 (18 July 2009)
   Source code location:    .
   Install binaries:        /usr/local/bacula/bin
   Install libraries:       /usr/lib
   Install config files:    /usr/local/bacula
   Scripts directory:       /usr/local/bacula
   Archive directory:       /tmp
   Working directory:       /usr/local/bacula
   PID directory:           /var/run
   Subsys directory:        /var/lock/subsys
   Man directory:           ${datarootdir}/man
   Data directory:          /usr/share
   Plugin directory:        /usr/lib
   C Compiler:              gcc 4.1.2
   C++ Compiler:            /usr/bin/g++ 4.1.2
   Compiler flags:           -g -O2 -Wall -fno-strict-aliasing -fno-exceptions -fno-rtti
   Linker flags:
   Libraries:               -lpthread -ldl
   Statically Linked Tools: no
   Statically Linked FD:    no
   Statically Linked SD:    no
   Statically Linked DIR:   no
   Statically Linked CONS:  no
   Database type:           MySQL
   Database port:
   Database lib:            -L/usr/lib64/mysql -lmysqlclient_r -lz
   Database name:           bacula
   Database user:           bacula

   Job Output Email:        root@localhost
   Traceback Email:         root@localhost
   SMTP Host Address:       localhost

   Director Port:           9101
   File daemon Port:        9102
   Storage daemon Port:     9103

   Director User:           bacula
   Director Group:          bacula
   Storage Daemon User:     bacula
   Storage DaemonGroup:     bacula
   File Daemon User:        root
   File Daemon Group:       root

   SQL binaries Directory   /usr/bin

   Large file support:      yes
   Bacula conio support:    yes -ltermcap
   readline support:        no
   TCP Wrappers support:    no
   TLS support:             yes
   Encryption support:      yes
   ZLIB support:            yes
   enable-smartalloc:       yes
   enable-lockmgr:          no
   bat support:             no
   enable-gnome:            no
   enable-bwx-console:      no
   enable-tray-monitor:     yes
   client-only:             no
   build-dird:              yes
   build-stored:            yes
   ACL support:             no
   XATTR support:           yes
   Python support:          yes -L/usr/lib64/python2.4/config -lpython2.4 -lutil -lrt
   Batch insert enabled:    yes


make all
make install

chown -R bacula.bacula /usr/local/bacula

Install Init Scripts and Set PATH[edit]

cd /usr/local/bacula-src/bacula-3.0.2/platforms/redhat

chmod +x bacula-dir
chmod +x bacula-sd
chmod +x bacula-fd

cp bacula-dir /etc/init.d
cp bacula-sd /etc/init.d
cp bacula-fd /etc/init.d

chkconfig --add bacula-dir
chkconfig --add bacula-sd
chkconfig --add bacula-fd
chkconfig mysqld on
chkconfig httpd on
  • Edit /etc/profile
    • Add "pathmunge /usr/local/bacula/bin/" under UID 0's (root's) path changes
# Path manipulation
if [ "$EUID" = "0" ]; then
        pathmunge /sbin
        pathmunge /usr/sbin
        pathmunge /usr/local/sbin
        pathmunge /usr/local/bacula/bin

Configure Firewall, Apache, phpmyadmin[edit]

  • Firewall
    • Run system-config-securitylevel-tui
    • Select "Customize" button
    • Enable "WWW (HTTP)" and "Secure WWW (HTTPS)"
    • Add "tcp:9101,udp:9101" to "Other ports"
    • Select "OK" twice to exit
  • Apache
    • edit /etc/httpd/conf/httpd.conf
      • set "ServerName kay.cs.transy.edu"
  • phpmyadmin
    • edit /usr/share/phpmyadmin/config.inc.php
      • Fill in random characters for 'blowfish_secret'
    • edit /etc/httpd/conf.d/phpmyadmin.conf
      • add "Allow from 10." below "Allow from 127.0.0.1"
  • Restart Apache
    • /etc/init.d/httpd restart


Configuring MySQL Database[edit]

  • /etc/init.d/mysqld start
    • Follow on-screen instructions to set root password for MySQL
    • Test logging into database: mysql -u root --password (quit to exit)
  • Browse to kay.cs.transy.edu/phpmyadmin
  • Login as 'root'
  • Click 'Priviledges'
  • Click 'Add new user'
    • Username: bacula
    • Host: localhost
    • Password: bacula
    • Select "Create database with same name and grant all privileges"
  • Click 'Go'
  • cd /usr/local/bacula
  • Edit 'make_mysql_tables'
    • Add "-u bacula --password" to allow login to mysql
      • 8th line should read: "if $bindir/mysql -u bacula --password $* -f <<END-OF-DATA"
  • Run ./make_mysql_tables
  • Edit 'bacula-dir.conf'
    • Under "Catalog {" set dbpassword = "bacula"

Basic Bacula Configuration[edit]

  • cd /usr/local/bacula
  • mkdir orginal_confs
  • cp *.conf original_confs/
  • Replace bacula-dir.conf with:

### B A C U L A  at KAY.CS.TRANSY.EDU ################################################################################
# For Bacula release 3.0.2 (18 July 2009) -- redhat
# Bacula Director Config File
# ____________________________________________________________________________________________________________________
# ###<<<<< EDIT HISTORY >>>>>###
# 08/22/09 - CLM - Stripped unecessary defaults and reorganized
#
#


### DIRECTOR/CATALOG/CONSOLE ##########################################################################################
Director {                            # define myself
  Name = kay.cs.transy.edu-dir
  DIRport = 9101                # where we listen for UA connections
  QueryFile = "/usr/local/bacula/query.sql"
  WorkingDirectory = "/usr/local/bacula"
  PidDirectory = "/var/run"
  Maximum Concurrent Jobs = 1
  Password = "h1MOeZFbaD5Yf++iWp0WjtZ2SDr2X3aSoHENNM2V8oe5"         # Console password
  Messages = Daemon
}

Catalog {
  Name = MyCatalog
  dbname = "bacula"; dbuser = "bacula"; dbpassword = "bacula"
}

Console {
  Name = kay.cs.transy.edu-mon
  Password = "eGlf6NJdgKyJiZdUWVAEbdtEEyVJ3vKUVsRKYBsZIgn1"
  CommandACL = status, .status
}

### STORAGE ##########################################################################################################
Storage {
  Name = File
  Address = kay                # N.B. Use a fully qualified name here
  SDPort = 9103
  Password = "li1Mzezq64b7Ece79JTrEJFVKYuvm1yKr8WDx70sjc7k"
  Device = FileStorage
  Media Type = File
}
### /STORAGE #########################################################################################################

### MESSAGING ########################################################################################################
Messages {
  Name = Standard
  mailcommand = "/usr/local/bacula/bin/bsmtp -h localhost -f \"\(Bacula\) \<%r\>\" -s \"Bacula: %t %e of %c %l\" %r"
  operatorcommand = "/usr/local/bacula/bin/bsmtp -h localhost -f \"\(Bacula\) \<%r\>\" -s \"Bacula: Intervention needed for %j\" %r"
  mail = root@localhost = all, !skipped
  operator = root@localhost = mount
  console = all, !skipped, !saved
  append = "/usr/local/bacula/log" = all, !skipped
  catalog = all
}

Messages {
  Name = Daemon
  mailcommand = "/usr/local/bacula/bin/bsmtp -h localhost -f \"\(Bacula\) \<%r\>\" -s \"Bacula daemon message\" %r"
  mail = root@localhost = all, !skipped
  console = all, !skipped, !saved
  append = "/usr/local/bacula/log" = all, !skipped
}
### /MESSAGING ######################################################################################################

#####################################################################################################################
#####################################################################################################################
#####################################################################################################################

### CLIENTS #########################################################################################################
Client {
  Name = kay.cs.transy.edu-fd
  Address = kay
  FDPort = 9102
  Catalog = MyCatalog
  Password = "9xNhJRzsiqGJeE5J2jd9xFNKk0TkZBEt7l9b1loMHlFr"          # password for FileDaemon
  File Retention = 30 days            # 30 days
  Job Retention = 6 months            # six months
  AutoPrune = yes                     # Prune expired Jobs/Files
}
### /CLIENTS ########################################################################################################

### SCHEDULES #######################################################################################################
Schedule {
  Name = "WeeklyCycleAfterBackup"
  Run = Full sun-sat at 23:10
}
### /SCHEDULES ######################################################################################################

### FILESETS ########################################################################################################
FileSet {
  Name = "Catalog"
  Include {
    Options {
      signature = MD5
    }
    File = /usr/local/bacula/bacula.sql
  }
}
### /FILESETS ######################################################################################################

### POOLS ##########################################################################################################
Pool {
  Name = Default
  Pool Type = Backup
  Recycle = yes                       # Bacula can automatically recycle Volumes
  AutoPrune = yes                     # Prune expired volumes
  Volume Retention = 365 days         # one year
}

### /POOLS #########################################################################################################

### JOBS ###########################################################################################################

JobDefs {
  Name = "DefaultJob"
  Type = Backup
  Level = Incremental
  Client = kay.cs.transy.edu-fd
  FileSet = "Catalog"
  Schedule = "WeeklyCycleAfterBackup"
  Storage = File
  Messages = Standard
  Pool = Default
  Priority = 10
}

Job {
  Name = "BackupClient1"
  JobDefs = "DefaultJob"
  Write Bootstrap = "/usr/local/bacula/Client1.bsr"
}

### /JOBS ##########################################################################################################


  • Replace bacula-sd.conf with:


### B A C U L A  at KAY.CS.TRANSY.EDU ################################################################################
# For Bacula release 3.0.2 (18 July 2009) -- redhat
# Bacula Storage Daemon Config File
# ____________________________________________________________________________________________________________________
# ###<<<<< EDIT HISTORY >>>>>###
# 08/22/09 - CLM - Stripped unecessary defaults and reorganized
#
#

Storage {                             # definition of myself
  Name = kay.cs.transy.edu-sd
  SDPort = 9103                  # Director's port
  WorkingDirectory = "/usr/local/bacula"
  Pid Directory = "/var/run"
  Maximum Concurrent Jobs = 20
}

Director {
  Name = kay.cs.transy.edu-dir
  Password = "li1Mzezq64b7Ece79JTrEJFVKYuvm1yKr8WDx70sjc7k"
}

Director {
  Name = kay.cs.transy.edu-mon
  Password = "WksLFW7L2zpv4A+FFAwI3bQujzKKy2WpEcpParM0vdQw"
  Monitor = yes
}

Device {
  Name = FileStorage
  Media Type = File
  Archive Device = /tmp
  LabelMedia = yes;                   # lets Bacula label unlabeled media
  Random Access = Yes;
  AutomaticMount = yes;               # when device opened, read it
  RemovableMedia = no;
  AlwaysOpen = no;
}

Messages {
  Name = Standard
  director = kay.cs.transy.edu-dir = all
}

  • Replace bacula-fd.conf with:

### B A C U L A  at KAY.CS.TRANSY.EDU ################################################################################
# For Bacula release 3.0.2 (18 July 2009) -- redhat
# Bacula File Daemon Config File
# ____________________________________________________________________________________________________________________
# ###<<<<< EDIT HISTORY >>>>>###
# 08/22/09 - CLM - Stripped unecessary defaults and reorganized
#
#

Director {
  Name = kay.cs.transy.edu-dir
  Password = "9xNhJRzsiqGJeE5J2jd9xFNKk0TkZBEt7l9b1loMHlFr"
}

Director {
  Name = kay.cs.transy.edu-mon
  Password = "Isi5abNFrjx4LNFvt23R/Z0N2ojcwTfeeWG62e+7O4ZC"
  Monitor = yes
}

FileDaemon {                          # this is me
  Name = kay.cs.transy.edu-fd
  FDport = 9102                  # where we listen for the director
  WorkingDirectory = /usr/local/bacula
  Pid Directory = /var/run
  Maximum Concurrent Jobs = 20
}

Messages {
  Name = Standard
  director = kay.cs.transy.edu-dir = all, !skipped, !restored
}


Web GUI Install (bweb)[edit]

  • Bweb is a Perl based web front-end to Bacula. Great for reporting and checking logs, though I wouldn't recommend using it to interface with the Bacula directore - use bconsole.
yum install perl-Date-Calc perl-Expect perl-HTML-Template perl-GD perl-GD-Graph perl-Time-ParseDate
*NOTE*: Perl's Time::ParseDate module is required but isn't available via 'yum' at this time. Might have to use cpan.

cd /usr/local/bacula-src/bacula-gui-3.0.2/bweb

  • Edit 'install_bweb'
    • Set CONF_DIR=/usr/local/bacula
    • Set WEB_DIR=/var/www/html
    • Set CGI_BIN=/var/www/cgi-bin
    • Set HTTP_USER=apache
    • Set HTTP_GROUP=apache
    • Set DB_PW="bacula"
  • Run "./bweb_install"
  • Run "mysql bacula -u bacula --password < script/bweb-mysql.sql"
  • Run "mkdir /var/spool/bweb"
  • Run "chown apache.apache /var/spool/bweb"
  • Browse to http://kay.cs.transy.edu/bweb. No data should be present as the daemons aren't running, but the page should render without data.
    • Select "Configuration" from top menu and set the following fields:
      • fv_write_path = /var/spool/bweb
      • bconsole = /usr/local/bacula/bin/bconsole -n -c /usr/local/bacula/bconsole.conf
      • wiki_url = http://www.cs.transy.edu/wiki
    • Click "Save"
    • Select and delete the default "autochanger"
  • To secure access to Bweb..
    • Run "htpasswd -c /etc/httpd/passwords root"
      • Set root password
    • Save the following to /etc/httpd/conf.d/bweb.conf:

#  Web application to manage Bacula
#

<Directory "/var/www/html/bweb">
  Order Deny,Allow
  Deny from all
  Allow from 127.0.0.1
  Allow from 10.

  AuthType Basic
  AuthName "Bacula's Bweb Interface"
  AuthUserFile /etc/httpd/passwords
  Require user root
</Directory>

<Directory "/var/www/cgi-bin/bweb">
  Order Deny,Allow
  Deny from all
  Allow from 127.0.0.1
  Allow from 10.

  AuthType Basic
  AuthName "Bacula's Bweb Interface"
  AuthUserFile /etc/httpd/passwords
  Require user root
</Directory>

First Run[edit]

  • As root, run "bacula start", you shouldn't get any errors.
  • Now launch the console interface to Bacula by running "bconsole"
    • Type "quit" to exit


Bacula Configuration[edit]

Clients[edit]

Pools[edit]

Schedules[edit]

Filesets[edit]

Jobs[edit]

Full Example: bacula-dir.conf[edit]

### B A C U L A  at KAY.CS.TRANSY.EDU ################################################################################
# For Bacula release 3.0.2 (18 July 2009) -- redhat
# Bacula Director Config File
# ____________________________________________________________________________________________________________________
# ###<<<<< EDIT HISTORY >>>>>###
# 08/22/09 - CLM - Stripped unecessary defaults and reorganized
# 08/26/09 - CLM - Full configuration for backup of servers and NFS data
#


### DIRECTOR/CATALOG/CONSOLE ##########################################################################################
Director {                            # define myself
  Name = kay.cs.transy.edu-dir
  DIRport = 9101                # where we listen for UA connections
  QueryFile = "/usr/local/bacula/query.sql"
  WorkingDirectory = "/usr/local/bacula"
  PidDirectory = "/var/run"
  Maximum Concurrent Jobs = 1
  Password = "h1MOeZFbaD5Yf++iWp0WjtZ2SDr2X3aSoHENNM2V8oe5"         # Console password
  Messages = Daemon
}

Catalog {
  Name = MyCatalog
  dbname = "bacula"; dbuser = "bacula"; dbpassword = "bacula"
}

Console {
  Name = kay.cs.transy.edu-mon
  Password = "eGlf6NJdgKyJiZdUWVAEbdtEEyVJ3vKUVsRKYBsZIgn1"
  CommandACL = status, .status
}

### STORAGE ##########################################################################################################
Storage {
  Name = File
  Address = kay                # N.B. Use a fully qualified name here
  SDPort = 9103
  Password = "li1Mzezq64b7Ece79JTrEJFVKYuvm1yKr8WDx70sjc7k"
  Device = FileStorage
  Media Type = File
}
### /STORAGE #########################################################################################################

### MESSAGING ########################################################################################################
Messages {
  Name = Standard
  mailcommand = "/usr/local/bacula/bin/bsmtp -h localhost -f \"\(Bacula\) \<%r\>\" -s \"Bacula: %t %e of %c %l\" %r"
  operatorcommand = "/usr/local/bacula/bin/bsmtp -h localhost -f \"\(Bacula\) \<%r\>\" -s \"Bacula: Intervention needed for %j\" %r"
  mail = root@localhost = all, !skipped
  operator = root@localhost = mount
  console = all, !skipped, !saved
  append = "/usr/local/bacula/log" = all, !skipped
  catalog = all
}

Messages {
  Name = Daemon
  mailcommand = "/usr/local/bacula/bin/bsmtp -h localhost -f \"\(Bacula\) \<%r\>\" -s \"Bacula daemon message\" %r"
  mail = root@localhost = all, !skipped
  console = all, !skipped, !saved
  append = "/usr/local/bacula/log" = all, !skipped
}
### /MESSAGING ######################################################################################################

#####################################################################################################################
#####################################################################################################################
#####################################################################################################################

### CLIENTS #########################################################################################################
Client {
  Name = kay.cs.transy.edu-fd
  Address = kay
  FDPort = 9102
  Catalog = MyCatalog
  Password = "9xNhJRzsiqGJeE5J2jd9xFNKk0TkZBEt7l9b1loMHlFr"          # password for FileDaemon
  File Retention = 30 days            # 30 days
  Job Retention = 6 months            # six months
  AutoPrune = yes                     # Prune expired Jobs/Files
}

Client {
  Name = babbage.cs.transy.edu-fd
  Address = babbage
  FDPort = 9102
  Catalog = MyCatalog
  Password = "3nFuu73Anv82Idnaypwoo38mzdAdnfEWH278AnE2ljBd"          # password for FileDaemon
  File Retention = 30 days            # 30 days
  Job Retention = 6 months            # six months
  AutoPrune = yes                     # Prune expired Jobs/Files
}

Client {
  Name = hollerith.cs.transy.edu-fd
  Address = hollerith
  FDPort = 9102
  Catalog = MyCatalog
  Password = "nm38sFNANDE82h1648FApoeppAbdg23bajy1i49BDY3h"          # password for FileDaemon
  File Retention = 30 days            # 30 days
  Job Retention = 6 months            # six months
  AutoPrune = yes                     # Prune expired Jobs/Files
}
### /CLIENTS ########################################################################################################

### SCHEDULES #######################################################################################################
Schedule {
  Name = "Classes"
  Run = Level=Incremental Pool=Nightly-Inc-Classes mon-sat at 1:00
  Run = Level=Full Pool=Weekly-Full-Classes sun at 1:00
}

Schedule {
  Name = "Homedirs"
  Run = Level=Incremental Pool=Nightly-Inc-Homedirs mon-sat at 4:00
  Run = Level=Full Pool=Weekly-Full-Homedirs sun at 4:00
}

Schedule {
  Name = "Babbage"
  Run = Level=Incremental Pool=Nightly-Inc-Babbage mon-sat at 1:30
  Run = Level=Full Pool=Weekly-Full-Babbage sun at 1:30
}

Schedule {
  Name = "Hollerith"
  Run = Level=Incremental Pool=Nightly-Inc-Hollerith mon-sat at 2:00
  Run = Level=Full Pool=Weekly-Full-Hollerith sun at 2:00
}

Schedule {
  Name = "OtherExportfs"
  Run = Level=Full Pool=Weekly-Full-OtherExportfs sun at 2:30
}

Schedule {
  Name = "Catalog"
  Run = Level=Full Pool=Nightly-Full-Catalog at 8:00
}

### /SCHEDULES ######################################################################################################

### FILESETS ########################################################################################################
FileSet {
  # For client Kay
  Name = "Catalog"
  Include {
    Options {
      Signature = MD5
      Compression = GZIP
    }
    File = /usr/local/bacula/bacula.sql
  }
}

FileSet {
  # For client Babbage
  Name = "Classes"
  Include {
    Options {
      Signature = MD5
      Compression = GZIP
      Recurse = Yes
    }
    File = /mnt/data/exportfs/classes
  }
}

FileSet {
  # For client Babbage
  Name = "Homedirs"
  Include {
    Options {
      Signature = MD5
      Compression = GZIP
      Recurse = Yes
      Exclude = yes
      IgnoreCase = yes

      # Exclude browser cache
      WildDir = "/mnt/data/exportfs/home/*/.mozilla/firefox/*/Cache"
      WildDir = "/mnt/data/exportfs/home/*/.netscape/*/Cache"

    }
    File = /mnt/data/exportfs/home
  }
}

FileSet {
  # For client Hollerith
  Name = "Hollerith"
  Include {
    Options {
      Signature = MD5
      Recurse = Yes
      Compression = GZIP
    }
    File = /home/www
    File = /var/www
    File = /etc
    File = /var/mysqlBackup.sql
  }
}

FileSet {
  # For client Babbage
  Name = "Babbage"
  Include {
    Options {
      Signature = MD5
      Recurse = Yes
      Compression = GZIP
    }
    File = /etc
    File = /var/mysqlBackup.sql
  }
}

FileSet {
  # For client Babbage
  Name = "OtherExportfs"
  Include {
    Options {
      Signature = MD5
      Recurse = Yes
      Compression = GZIP
    }
    File = /mnt/data/exportfs/usrlocal65
    File = /mnt/data/exportfs/usrlocalmac
    File = /mnt/data/exportfs/usrlocalneko
    File = /mnt/data/exportfs/labdata
  }
}

### /FILESETS ######################################################################################################

### POOLS ##########################################################################################################
Pool {
  Name = Nightly-Inc-Classes
  Pool Type = Backup
  Storage = File
  Label Format = "Nightly-Inc-Classes-"
  Catalog Files = yes
  Recycle = yes
  AutoPrune = yes
  Volume Retention = 7 days
  Maximum Volume Jobs = 1
}

Pool {
  Name = Nightly-Inc-Homedirs
  Pool Type = Backup
  Storage = File
  Label Format = "Nightly-Inc-Homedirs-"
  Catalog Files = yes
  Recycle = yes
  AutoPrune = yes
  Volume Retention = 7 days
  Maximum Volume Jobs = 1
}

Pool {
  Name = Nightly-Inc-Babbage
  Pool Type = Backup
  Storage = File
  Label Format = "Nightly-Inc-Babbage-"
  Catalog Files = yes
  Recycle = yes
  AutoPrune = yes
  Volume Retention = 7 days
  Maximum Volume Jobs = 1
}

Pool {
  Name = Nightly-Inc-Hollerith
  Pool Type = Backup
  Storage = File
  Label Format = "Nightly-Inc-Hollerith-"
  Catalog Files = yes
  Recycle = yes
  AutoPrune = yes
  Volume Retention = 7 days
  Maximum Volume Jobs = 1
}

Pool {
  Name = Weekly-Full-Babbage
  Pool Type = Backup
  Storage = File
  Label Format = "Weekly-Full-Babbage-"
  Catalog Files = yes
  Recycle = yes
  AutoPrune = yes
  Volume Retention = 1 month
  Maximum Volume Jobs = 1
}

Pool {
  Name = Weekly-Full-Hollerith
  Pool Type = Backup
  Storage = File
  Label Format = "Weekly-Full-Hollerith-"
  Catalog Files = yes
  Recycle = yes
  AutoPrune = yes
  Volume Retention = 1 month
  Maximum Volume Jobs = 1
}

Pool {
  Name = Weekly-Full-Classes
  Pool Type = Backup
  Storage = File
  Label Format = "Weekly-Full-Classes-"
  Catalog Files = yes
  Recycle = yes
  AutoPrune = yes
  Volume Retention = 1 month
  Maximum Volume Jobs = 1
}

Pool {
  Name = Weekly-Full-Homedirs
  Pool Type = Backup
  Storage = File
  Label Format = "Weekly-Full-Homedirs-"
  Catalog Files = yes
  Recycle = yes
  AutoPrune = yes
  Volume Retention = 1 month
  Maximum Volume Jobs = 1
}

Pool {
  Name = Weekly-Full-OtherExportfs
  Pool Type = Backup
  Storage = File
  Label Format = "Weekly-Full-OtherExportfs-"
  Catalog Files = yes
  Recycle = yes
  AutoPrune = yes
  Volume Retention = 2 weeks
  Maximum Volume Jobs = 1
}

Pool {
  Name = Nightly-Full-Catalog
  Pool Type = Backup
  Storage = File
  Label Format = "Nightly-Full-Catalog-"
  Catalog Files = yes
  Recycle = yes
  AutoPrune = yes
  Volume Retention = 7 days
  Maximum Volume Jobs = 1
}

### /POOLS #########################################################################################################

### JOBS ###########################################################################################################

Job {
  Name = "Catalog"
  Type = Backup
  Level = Full
  FileSet="Catalog"
  Pool = "Nightly-Full-Catalog"
  Client = kay.cs.transy.edu-fd
  Schedule = "Catalog"
  Messages = Standard
  RunBeforeJob = "/usr/local/bacula/make_catalog_backup bacula bacula bacula" # AHHH! ;)
  RunAfterJob  = "/usr/local/bacula/delete_catalog_backup"
  Write Bootstrap = "/usr/local/bacula/BackupCatalog.bsr"
  Priority = 11                   # run after main backup
}

Job {
  Name = "Classes"
  Type = Backup
  FileSet = "Classes"
  Client = babbage.cs.transy.edu-fd
  Schedule = "Classes"
  Messages = Standard

  # Overidden by Schedule but useful as default for manual run
  Level = Full
  Pool = Weekly-Full-Classes
}

Job {
  Name = "Homedirs"
  Type = Backup
  FileSet = "Homedirs"
  Client = babbage.cs.transy.edu-fd
  Schedule = "Homedirs"
  Messages = Standard

  # Overidden by Schedule but useful as default for manual run
  Level = Full
  Pool = Weekly-Full-Homedirs
}

Job {
  Name = "Babbage"
  Type = Backup
  FileSet = "Babbage"
  Client = babbage.cs.transy.edu-fd
  Schedule = "Babbage"
  Messages = Standard

  # Overidden by Schedule but useful as default for manual run
  Level = Full
  Pool = Weekly-Full-Babbage
}

Job {
  Name = "Hollerith"
  Type = Backup
  FileSet = "Hollerith"
  Client = hollerith.cs.transy.edu-fd
  Schedule = "Hollerith"
  Messages = Standard

  # Overidden by Schedule but useful as default for manual run
  Level = Full
  Pool = Weekly-Full-Hollerith
}

Job {
  Name = "OtherExportfs"
  Type = Backup
  FileSet = "OtherExportfs"
  Client = babbage.cs.transy.edu-fd
  Schedule = "OtherExportfs"
  Messages = Standard

  # Overidden by Schedule but useful as default for manual run
  Level = Full
  Pool = Weekly-Full-OtherExportfs
}

# The "restore" job (necessary
Job {
Name = "Restore"
Type = Restore
Client = kay.cs.transy.edu-fd
Where = /mnt/data/bacula-restore/
Messages = Standard

# Meaningless but required
Pool = Weekly-Full-Homedirs
Fileset = "Homedirs"
}

### /JOBS ##########################################################################################################                                                                                         

Client Installation[edit]

  • RPMs:

File:Bacula-client-3.0.2-1.el5.x86 64.rpm

  1. Download the appropriate RPM above.
  2. As root, run "rpm -ivh Bacula-client-3.0.2-1.el5.x86_64.rpm"
  3. Edit /etc/bacula/bacula-fd.conf:
    1. The password under the first "Director" section should be randomly generated for each client. Make note of this password as it will need to be entered in the server's bacula-dir.conf config.
    2. The name under the "FileDaemon" should be changed to match the client's FQDN followed by "-fd".

### B A C U L A  at BABBAGE.CS.TRANSY.EDU ################################################################################
# For Bacula release 3.0.2 (18 July 2009) -- redhat
# Bacula File Daemon Config File
# ____________________________________________________________________________________________________________________
# ###<<<<< EDIT HISTORY >>>>>###
# 08/23/09 - CLM - Original config
#
#

Director {
  Name = kay.cs.transy.edu-dir
  Password = "3nFuu73Anv82Idnaypwoo38mzdAdnfEWH278AnE2ljBd"
}

Director {
  Name = kay.cs.transy.edu-mon
  Password = "Isi5abNFrjx4LNFvt23R/Z0N2ojcwTfeeWG62e+7O4ZC"
  Monitor = yes
}

FileDaemon {                          # this is me
  Name = babbage.cs.transy.edu-fd
  FDport = 9102                  # where we listen for the director
  WorkingDirectory = /var/lib/bacula
  Pid Directory = /var/run
  Maximum Concurrent Jobs = 20
}

Messages {
  Name = Standard
  director = kay.cs.transy.edu-dir = all, !skipped, !restored
}

  1. Use "system-config-securitylevel-tui" to open 9102:tcp,9102:udp
  2. Complete the client's configuration by adding the appropriate "Client {" section on the server's bacula-dir.conf