Bacula 1. download source on both server/clients and untar from http://www.bacula.org/en/ tar zxvf bacula-.tar.gz 2. configure and install = Server yum mysql mysql-server mysql-devel cd bacula- ./configure --with-mysql && make && make install cp scripts/bacula /etc/init.d/ chmod 744 /etc/init.d/bacula = Clients (server that we want to backup) yum mysql mysql-server cd bacula- ./configure --enable-client-only && make && make install cp scripts/bacula /etc/init.d/ chmod 744 /etc/init.d/bacula Note: Bacula has 3 major components: bacula-dir (bacula-directory) runs as daemon to control everything. bacula-sd (bacula-storage daemon) runs on server that we want to store backup files on bacula-fd (bacula file daemon) runs on servers that want to be backup 3. Create database for bacula (On Server only) cd /etc/bacula ./create_mysql_database ./make_bacula_tables ./grant_mysql_privileges ./make_catalog_backup Note: You may need to change "bindir=" in above script to point to the path of mysql 4. Configuration === Storage Daemon (on system that we want to store backup files, usually on the server that run director daemon, on the small site) vi /etc/bacula/bacula-sd.conf Change "Name" and "Password" of director and director-mon (name/password are in director conf file) Change infomation about "Device" (where to store the backup files) e.g. Device { Name = FileStorage Media Type = File Archive Device = /backup # Store backup files under /backup LabelMedia = yes; # lets Bacula label unlabeled media Random Access = Yes; AutomaticMount = yes; # when device opened, read it RemovableMedia = no; AlwaysOpen = no; } === File Daemon (on server that we want to backup) vi /etc/bacula/bacula-fd.conf Change "Name" and "Password" of director and director-mon (name/password are in director conf file) === Director (on Server) In director configuration file, you need to change at least 6 directive: director, job, client, storage, schedule and fileset Director You can change "Name", "Password", and "Maximum Concurrent Jobs". And should leave everything else as is. Note: Name and password will be used on all "File Daemon"(clients) and Storage Daemon. Client 1. Define about the clients, which clients that we want to backup You need to define every clients that you want to backup here. Client { Name = alpha-fd Address = alpha FDPort = 9102 Catalog = MyCatalog Password = "XXXXX" # password for FileDaemon File Retention = 30 days # 30 days Job Retention = 6 months # six months AutoPrune = yes # Prune expired Jobs/Files } Client { Name = beta-fd Address = beta FDPort = 9102 Catalog = MyCatalog Password = "XXXXX" # password for FileDaemon File Retention = 30 days # 30 days Job Retention = 6 months # six months AutoPrune = yes # Prune expired Jobs/Files } Catalog # Edit catalog (Mysql host/db/user/password) Catalog { Name = MyCatalog dbname = bacula DB address = alpha user = bacula password = "" } Fileset 1. Define What to backup You can have multiple filesets for each clients. e.g. FileSet { Name = "Root_Home" Include { Options { signature = MD5 } File = /root # Backup root File = /home # Bacup home # File = / # Backup everything } Exclude { File = /proc File = /tmp File = /.journal File = /.fsck } } FileSet { Name = "Full Set" Include { Options { signature = MD5 } File = / # Backup everything } Exclude { File = /proc File = /tmp File = /.journal File = /.fsck } } Schedule 1. Define when to backup Schedule { Name = "WeeklyCycle" Run = Full 1st sun at 23:05 Run = Differential 2nd-5th sun at 23:05 Run = Incremental mon-sat at 23:05 } Pool 1. Define how the backup files are keep (how long, recyclable?, autoprune) Example of pool definition: # Default pool definition Pool { Name = Default Pool Type = Backup Recycle = yes # Bacula can automatically recycle Volumes AutoPrune = yes # Prune expired volumes Volume Retention = 365 days # one year } Storage 1. Define where to put the backup files 2. Definition of file storage device Storage { Name = File # Do not use "localhost" here Address = alpha # N.B. Use a fully qualified name here SDPort = 9103 Password = "XXXXX" # Must match the password of conf in storage daemon conf file Device = FileStorage Media Type = File } Note: Typically, storage configuration is in the following format, please check the manual for possible values: Schedule{ Name = The name of the schedule being defined. The Name directive is required. Run = } JobDefs 1. How to backup (full, incre,), how often Example of jobdefs JobDefs { Name = "BackupFullSet" Type = Backup Level = Incremental FileSet = "Full Set" Schedule = "WeeklyCycle" Storage = File Messages = Standard Pool = Default Priority = 10 } JobDefs { Name = "BackupRootHome" Type = Backup Level = Incremental FileSet = "Root_Home" Schedule = "WeeklyCycle" Storage = File Messages = Standard Pool = Default Priority = 10 } Job 1. Summary who, what, where, when Job { Name = "Backup BETA-Full" Client = beta-fd JobDefs = "DefaultJob" Write Bootstrap = "/var/bacula/working/beta.bsr" } Job { Name = "Backup Gamma-Root_Home" Client = gamma-fd JobDefs = "BackupRootHome" Write Bootstrap = "/var/bacula/working/gamma.bsr" } Job { Name = "Backup Alpha-Root_Home" Client = alpha-fd JobDefs = "BackupRootHome" Write Bootstrap = "/var/bacula/working/alpha.bsr" } 6. Start bacula service bacula start 7. Start bconsole /etc/bacula/bconsole.conf Password XXXXXX bconsole 7.1 Show command * help 7.2 Label the tape (storage) * label -> Enter the volume name -> Select pool(see director conf for pool info) 7.3 Status of director (schefule jobs, running jobs, terminated job) * status -> 1 7.4 Show client * show clients 7.5 Backup manually * run -> (job number) Restore bconsole $5 $ls tmp/ $mark tmp $done === Server config Director { # define myself Name = server1-dir DIRport = 9101 # where we listen for UA connections QueryFile = "/etc/bacula/query.sql" WorkingDirectory = "/var/bacula/working" PidDirectory = "/var/run" Maximum Concurrent Jobs = 20 Password = "88390LPP" # Console password Messages = Daemon } Job { Name = "Backup TMP-Full" Client = server2-fd JobDefs = "BackupTMP" Write Bootstrap = "/var/bacula/working/beta.bsr" } Job { Name = "RestoreFiles" Type = Restore Client=server2-fd FileSet="TMP" Storage = File Pool = Default Messages = Standard Where = /tmp } JobDefs { Name = "BackupTMP" Type = Backup Level = Incremental FileSet = "TMP" Schedule = "WeeklyCycle" Storage = File Messages = Standard Pool = Default Priority = 10 } FileSet { Name = "TMP" Include { Options { signature = MD5 } File = /tmp # Bacup home } Exclude { File = /proc File = /tmp File = /.journal File = /.fsck } } Schedule { Name = "WeeklyCycle" Run = Full 1st sun at 23:05 Run = Differential 2nd-5th sun at 23:05 Run = Incremental mon-sat at 23:05 } FileSet { Name = "Catalog" Include { Options { signature = MD5 } File = /var/bacula/working/bacula.sql } } Client { Name = server2-fd Address = server2 FDPort = 9102 Catalog = MyCatalog Password = "88390LPP" # password for FileDaemon File Retention = 30 days # 30 days Job Retention = 6 months # six months AutoPrune = yes # Prune expired Jobs/Files } Storage { Name = File # Do not use "localhost" here Address = server1 # N.B. Use a fully qualified name here SDPort = 9103 Password = "88390LPP" Device = FileStorage Media Type = File } Catalog { Name = MyCatalog dbname = bacula #DB address = localhost DB address = server1 user = bacula password = "" } Pool { Name = Default Pool Type = Backup Recycle = yes # Bacula can automatically recycle Volumes AutoPrune = yes # Prune expired volumes Volume Retention = 365 days # one year } Messages { Name = Daemon mailcommand = "/sbin/bsmtp -h localhost -f \"\(Bacula\) \<%r\>\" -s \"Bacula daemon message\" %r" mail = root@localhost = all, !skipped console = all, !skipped, !saved append = "/var/bacula/working/log" = all, !skipped } Messages { Name = Standard mailcommand = "/sbin/bsmtp -h localhost -f \"\(Bacula\) \<%r\>\" -s \"Bacula: %t %e of %c %l\" %r" operatorcommand = "/sbin/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 = "/var/bacula/working/log" = all, !skipped } cat bacula-fd.conf Director { Name = server1-dir Password = "88390LPP" } Director { Name = server1-mon Password = "88390LPP" Monitor = yes } FileDaemon { # this is me Name = server1-fd FDport = 9102 # where we listen for the director WorkingDirectory = /var/bacula/working Pid Directory = /var/run Maximum Concurrent Jobs = 20 } Messages { Name = Standard director = server1-dir = all, !skipped, !restored } cat bacula-sd.conf Storage { # definition of myself Name = server1-sd SDPort = 9103 # Director's port WorkingDirectory = "/var/bacula/working" Pid Directory = "/var/run" Maximum Concurrent Jobs = 20 } Director { Name = server1-dir Password = "88390LPP" } Director { Name = server1-mon Password = "88390LPP" Monitor = yes } Device { Name = FileStorage Media Type = File Archive Device = /backup 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 = server1-dir = all } === client cat bacula-fd.conf Director { #Name = server2-dir #Password = "YrXDRfYhhfWCZznsn23yCPdvtKawmP/3lcwGZ/ugCrU7" Name = server1-dir Password = "88390LPP" } Director { #Name = server-mon #Password = "bF/ERomajjph+1lrjlWacKV5yxM/w+6E5u1eSzJUuyFB" #Name = server2-mon Name = server2-mon Password = "88390LPP" Monitor = yes } FileDaemon { # this is me Name = server2-fd FDport = 9102 # where we listen for the director WorkingDirectory = /var/bacula/working Pid Directory = /var/run Maximum Concurrent Jobs = 20 } Messages { Name = Standard director = server2-dir = all, !skipped, !restored }