Over the past couple of hours I’ve been battling away trying to get the Win32 Bacula agent to back up my Windows Server 2008 System State. We’ll use “Client Run Before Job” commands to trigger client-side scripts to run the client-side backup jobs…

System state backups copy the C:\Windows\System32\cmd.exe to C:\Backup
Create a text file in C:\Backup named “BackupSystemState.cmd” with the following contents (watch for line-wrapping, the following should be on 2 lines, each starting with “start /W”):

start /W "" c:\backup\cmd.exe /C start /W "" c:\windows\system32\wbadmin delete systemstatebackup -backupTarget:d: -keepVersions:0 -quiet
start /W "" c:\backup\cmd.exe /C start /W "" c:\windows\system32\wbadmin start systemstatebackup -backupTarget:d: –quiet

This script works by first of all launching the command-prompt, then in turn launching the wbadmin backup process. The 2 commands being run here first of all delete any existing System State backups from D:, then starts a new System State backup with D: as the target volume.

Next, we’ll edit our Bacula client config again, adding the following new FileSet and Job:

Job {
 Name = "Exchange SS"
 JobDefs = "DefaultJob"
 Schedule = "MondayFull"
 Client = exchange-fd
 FileSet = "Exchange SS"
 Write Bootstrap = "/var/lib/bacula/exchangess.bsr"
 Level = Full
 Client Run Before Job = "C:/Backup/BackupSystemState.cmd"
FileSet {
 Name = "Exchange SS"
Include {
 Options {
 signature = MD5
 compression = GZIP
 File = D:/
 File = C:/Windows/Logs/WindowsServerBackup/

After reloading the Bacula config, you should be all set!