Main
Continous Data Protection (CDP) also called continuous backup or real-time backup, refers to backup of Client data by automatically saving a copy of every change made to that data, essentially capturing every version of the data that the user saves. It allows the user or administrator to restore data to any point in time.
The Bacula Enterprise CDP feature is composed of two components. A application (cdp-client or tray-monitor) that will monitor a set of directories configured by the user and a Bacula FileDaemon plugin responsible to secure the data on a Bacula infrastructure.
The user application (cdp-client or tray-monitor) is responsible to monitor files and directories. When a modification is detected, a copy of the new data is done into a spool directory. At a regular interval, a Bacula backup job will contact the FileDaemon and will save all the files archived by the cdp-client. The local data can be restored at any time without a network connection to the Director.
As with all Bacula plugins, the Plugin Directory directive in the FileDaemon resource of the bacula-fd.conf file needs to be set:
FileDaemon { Name = test-fd ... Plugin Directory = /opt/bacula/plugins }
In order to configure the CDP Plugin, one of the following parameters must be set:
The following parameters are used in the CDP job.
FileSet { Name = cdp Include { Options { compression = LZO } Plugin = "cdp: userHome=/home/user1" } } Job { Name = CDP Client = myclient-fd Type = Backup Pool = Default Schedule = Hourly # Choose a schedule Messages = Standard FileSet = cdp }
You can setup the folders you wish to watch for changes by using the Tray Monitor.
Open the Tray Monitor options and click in the option Watch...:
You should see a window displaying the watched folders. Click in the button Add:
Select the folder you wish to watch:
You should see the watched folder listed, as in the image below:
The Spool Directory contains all files from the watched folders that were created and / or changed. It keeps a copy of every version of the files.
An example of this directory can be seen below:
You must schedule backup jobs with a proper Files in order to backup those files with Bacula. Following this example, the job configuration would be:
FileSet { Name = cdp Include { Options { compression = LZO } Plugin = "cdp: userHome=/home/user1" } } Job { Name = CDP Client = myclient-fd Type = Backup Pool = Default Schedule = Hourly # Choose a schedule Messages = Standard FileSet = cdp }
The Job reads the journal file to select which files from the Spool Directory should be backed up. After that, the files will be available to be restored at any time:
It's necessary to keep either the cdp-client or the tray-monitor running in order to protect the directories being watched.