Bacula

Bacula an Open Source network backup and restore solution.

install bacula

first edit bacula-dir.conf  bacula-fd.conf bacula-sd.conf and bconsole.conf

as in this picture:


edit bacula-dir.conf

write Catalog section to work with mysql:


Catalog {
Name = MyCatalog
dbname = bacula; DB Address = «127.0.0.1»; dbuser = «bacula»; dbpassword = «SECRET»
}
write Client section to indicate computer that will be backup
Client {
Name = linux-001-fd
Address = 172.16.0.152
FDPort = 9102
Catalog = MyCatalog
Password = "SECRET FROM bacula-fd.conf «
File Retention = 28 days
Job Retention = 28 days
AutoPrune = yes
write FileSet section to indicate files and dirs that will be backup
FileSet {
Name = „standart-lnx“
Include {
Options {
signature = MD5
}
File = /etc
File = /var/log
}
}
write Message section to indicate format of information messages
Messages {
Name = Standard
mailcommand = „/usr/lib/bacula/bsmtp -h localhost -f \“\(Bacula\) \<%r\>\» -s \"Bacula: %t %e of %c %l\" %r"
operatorcommand = «/usr/lib/bacula/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/lib/bacula/log» = all, !skipped
catalog = all
}
write Pool sections
Pool {
Name = Remote
Pool Type = Backup
Recycle = yes                                                          # Bacula can automatically recycle Volumes
AutoPrune = yes                                                   # Prune expired volumes
Volume Retention = 365 days                        # one year
Maximum Volume Bytes = 500G                  # Limit Volume size to something reasonable
Maximum Volumes = 100                               # Limit number of Volumes in Pool, every volume size 500Gb
}

Pool {
Name = IncLocal
Pool Type = Backup
Use Volume Once = no
Recycle = yes                                                                      # Bacula can automatically recycle Volumes
AutoPrune = yes                                                               # Prune expired volumes
Volume Retention = 7 days                                         # week
Maximum Volume Bytes = 214748364800         # 200Gb
Maximum Volumes = 5                                                 # Limit number of Volumes in Pool
Maximum Volume Jobs = 9                                        # number of backups in one pool
}
write Schedule section to indicate period of backup
Schedule {
Name = «MonthlyFull»
Run = Level=Full on 1st january-december at 04:00
}

Schedule {
Name = «WeeklyDiff»
Run = Level=Differential on saturday at 04:00
}

Schedule {
Name = «DailyInc»
Run = Level=Incremental on monday-friday at 04:00
}
write Storage section to indicate where file and dirs will be stored
Storage {
Name = RemoteStorage
Address = 172.16.0.152                                                                            # N.B. Use a fully qualified name here
SDPort = 9103
Password = «EKi22qhxOjo8So41D6T0bMDVY1dxfaiXj»
Device = RemoteStorage                                                                         # name from your Device section from bacula-sd.conf
Media Type = File
}
write Job section to indicate files and dirs that will be backup
Job {
Name = « linux-001-full»
Type = Backup
Level = Full                                        # type of the backup ( Full, Differential or Incremental )
Client=linux-001-fd                       # name from Client section
FileSet="standart-lnx"                  # type name of FileSet (you can make more than 1 FileSet for backup different files and dirs on dirrefent servers and workstations)
Storage = RemoteStorage          # name of file storage, place where you will save your backups
Pool = Remote                                 # it's a pool of storable adjustments for files of volumes in which are stored backups
Messages = Standard                   # name of message format section
Schedule = «MonthlyFull»           # name of schedule
}

edit bacula-sd.conf

write Device section to indicate files and dirs that will be backup
Device {
Name = RemoteStorage
Media Type = File
Archive Device = /media/remote              # this is a path where you will be storage your backups
Random Access = Yes;
RemovableMedia = no;
AlwaysOpen = no;
}

edit bacula-fd.conf

FileDaemon {
Name = linux-001-fd
FDport = 9102                                                          # port where we listen for the director
WorkingDirectory = /var/lib/bacula
Pid Directory = /var/run/bacula
Maximum Concurrent Jobs = 20
FDAddress = 172.16.0.152                                # ip address of file daemon machine
}
From shell:
user@shell# bacula-console
*add pool=NameOfYourPool storage=NameOfYourStorage <press enter>
enter count of volumes you need
enter base-name part of volumes (for example IncrementLocalVolume)
enter 1sf number of end-name part: 1 (will be IncrementLocalVolume0001, IncrementLocalVolume0002, etc...)
*label pool=NameOfYourPool  storage=NameOfYourStorage volume=IncrementLocalVolume0001
yes
*label pool=NameOfYourPool  storage=NameOfYourStorage volume=IncrementLocalVolume0002
yes
etc...
that's all