Bacula

From wiki
Jump to: navigation, search


Contents

Installing MySql Server

First you must install Mysql-server for the database that bacula will create and use.
- sudo apt-get update
- sudo apt-get install mysql-server

Installing Bacula

To install Bacula enter open the Command Line console.
- sudo apt-get install bacula-server bacula-client

Then you must create a parent directory for bacula to store all of the backup files and restore files in.
- sudo mkdir -p /bacula/backup /bacula/restore
- sudo chown -R bacula:bacula /bacula
- sudo chmod -R 700 /bacula

Configuring Bacula

You must edit the Bacula-dir.conf file inside the the bacula directory.
- cd /etc/bacula

You can use emacs or vi to edit the file. (I use vi)

Configuring bacula-dir.conf


- sudo vi bacula-dir.conf

Find the Job section of the code. Find the Job that has the name "RestoreFiles" and chande the where to be equal to the restore directory.
- Job {
   Name = "RestoreFiles"
   Type = Restore
   Client=Blank-fd
   FileSet="Full Set"
   Storage = File
   Pool = Default
   Messages = Standard
   Where = /bacula/restore
}

Next you must find the section where it it declares the FileSet. In the FileSet section you must add the compression in which you want it to be saved as. Also you must tell Bacula what files or directories you want to backup.
- Include {
  Options {
   signature = MD5
   compression = GZIP
  }

    File = /Home
}

Next change the second files name under the Exclude title. You must change it from the default file directory to you newly created bacula directory.
-Exclude {
   File = /var/lib/bacula
   File = /bacula
   File = /proc
   File = /tmp
   File = /.journal
   File = /.fsck
}

Configuring bacula-sd.conf


Next you must edit the bacula-sd.conf file. Once again you can use emacs or vi to edit the file. (I use vi)
- sudo vi bacula-sd.conf

- Device {
   Name = FileStorage
   Media Type = File
   Archive Device = /bacula/backup
   LabelMedia = yes;
   Random Access = Yes;
   AutomaticMount = yes;
   RemovableMedia = no;
   AlwaysOpen = no;
}

Checking the Configuration

First check to see if the bacula-dir.conf is configured correctly without errors. If there is no errors it will just feed you back you prompt again.
- sudo bacula-dir -tc /etc/bacula/bacula-dir.conf

Next you need to check to make sure the other configuration file is configured correctly as well.
- sudo bacula-sd -tc /etc/bacula/bacula-sd.conf

Finally you must restart the bacula services with the new configurations.
- sudo service bacula-sd restart
- sudo service bacula-director restart

Testing Backup

- sudo bconsole
- label

Enter the name of what you want your backup to be named.
- select file
- run
- Choose #1. BackupClient1
- yes

Testing Restore

- sudo bconsole
- restore all
- Choose #5. Select the most recent backup for a client
- done
- yes
- exit

Sources


Source: https://www.digitalocean.com/community/articles/installing-and-configuring-bacula-on-an-ubuntu-12-04-vps

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox