Bacula - KeegMitch/Operations-Engineering-group-c GitHub Wiki

Install with this command

sudo apt-get install bacula-server bacula-client

Create a Puppet manifest to configure Bacula.

bacula-dir.conf

Job {
  Name = "BackupLocalFiles"
  JobDefs = "DefaultJob"
}

Job {
  Name = "RestoreLocalFiles"
  Type = Restore
  Client=BackupServer-fd
  FileSet="Full Set"
  Storage = File
  Pool = Default
  Messages = Standard
  Where = /bacula/restore
}

FileSet {
  Name = "Full Set"
  Include {
    Options {
      signature = MD5
      compression = GZIP
    }    
File = /
}
  Exclude {
    File = /var/lib/bacula
    File = /bacula
    File = /proc
    File = /tmp
    File = /.journal
    File = /.fsck
  }
}

Storage {
  Name = File
# Do not use "localhost" here
  Address = backup_server_private_FQDN                # N.B. Use a fully qualified name here
  SDPort = 9103
  Password = "ITXAsuVLi1LZaSfihQ6Q6yUCYMUssdmu_"
  Device = FileStorage
  Media Type = File
}

# File Pool definition
Pool {
  Name = File
  Pool Type = Backup
  Label Format = Local-
  Recycle = yes                       # Bacula can automatically recycle Volumes
  AutoPrune = yes                     # Prune expired volumes
  Volume Retention = 365 days         # one year
  Maximum Volume Bytes = 50G          # Limit Volume size to something reasonable
  Maximum Volumes = 100               # Limit number of Volumes in Pool
}


bacula-sd.conf

Storage {                             # definition of myself
  Name = BackupServer-sd
  SDPort = 9103                  # Director's port
  WorkingDirectory = "/var/lib/bacula"
  Pid Directory = "/var/run/bacula"
  Maximum Concurrent Jobs = 20
  SDAddress = backup_server_private_FQDN
}

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


Bacula vs Rsync

Bacula has built in scheduling that allow for automated or incremental backups. Rsync does not have any built like that and instead must be used with other scheduling tools like cron jobs.

Bacula has a catalog database to keep track of the backed up files which can allow for easer restores and queries, Rsync doesn't have this feature and files it backs up have to be tracked manually

Bacula can Support various storage devices, including disk, tape, and cloud storage. Rsync is Primarily used for file synchronization between directories or networked systems; storage management is manual.

With Bacula it allows granular restores from the catalog, including specific files or entire systems. While with rsync its restores are manual and based on directory structures; granularity is achieved through file selection in scripts.