Bacula

From wiki.adammorgan.org
Jump to: navigation, search

Creating new backup job

  • After installing the client on a workstation, there are 3 necessary steps to configure the server to back-up that client. The following examples assumes you're setting-up backups for a server named "myserver", and that you're going to use the existing conf file for "oldserver" as a starting template.
  • First SSH into the appropriate Bacula server:

Create a conf file for the new host to be backed-up

Each host being backed-up has its own conf file located in /etc/bacula/conf.d/. (eg. oldserver.conf).

  • Create a copy of an existing conf file.
cd /etc/bacula/conf.d
cp oldserver.conf myserver.conf
  • Open the new conf file in vi.
vi myserver.conf
  • Find and replace all instances of the other server's name with your new server's name. In this example, you're changing all instances of "oldserver" to the name of the new computer for which you're setting-up a job, which is "myserver".
:%s/oldserver/myserver/g
  • Enter edit/insert mode.
i
  • Change the "Address" field to reflect the IP for "myserver".
  • Change the file paths to reflect what directories on "myserver" you want backed-up.
    • Ensure you use forward-slashes (even if "myserver" is a windows machine)!
    • If a path includes spaces, you must enclose the entire path in quotation marks!
#  FILES TO INCLUDE IN BACKUP
        File = d:/somefolder
        File = "c:/users/jdoe/my documents"
  • Hit "Esc" (to leave insert/edit mode). Then save the file and exit.
[Esc]
:x

Edit bacula-dir.confAdd your new conf file to the list

Open bacula-dir.conf in vi.

cd /etc/bacula
vi bacula-dir.conf

Enter edit/insert mode.

i

Add a new line at the bottom specifying the path to the new conf file you just made.

@/etc/bacula/conf.d/myserver.conf
  • Hit "Esc" (to leave insert/edit mode). Then save the file and exit.
[Esc]
:x

Restart Bacula Daemon

After you've made your changes, you must restart the bacula service.

cd /etc/bacula
bacula restart

If there are any errors or problems, they'll be displayed at this point; otherwise you're done.

Bconsole notes

Is my restore job finished?

  • After you begin a job, it'll say "Job queued" and give you the JobId.
  • Right-click the title bar of the bconsole window, go to "Properties", and change window width to "120".
  • Use this command to show basic info about the job (name, starttime, status)
list jobid=####

The output will look like this:

*list jobid=5293
+-------+--------------+---------------------+------+-------+----------+----------+-----------+
| JobId | Name         | StartTime           | Type | Level | JobFiles | JobBytes | JobStatus |
+-------+--------------+---------------------+------+-------+----------+----------+-----------+
| 5,293 | RestoreFiles | 2014-12-16 14:18:11 | R    | F     |        0 |        0 | R         |
+-------+--------------+---------------------+------+-------+----------+----------+-----------+

Look at "JobStatus". Here's the different status types:

T 	Terminated normally
C 	Created but not yet running
R 	Running
B 	Blocked
E 	Terminated in Error
e 	Non-fatal error
f 	Fatal error
D 	Verify Differences
A 	Canceled by the user
F 	Waiting on the File daemon
S 	Waiting on the Storage daemon
m 	Waiting for a new Volume to be mounted
M 	Waiting for a Mount
s 	Waiting for Storage resource
j 	Waiting for Job resource
c 	Waiting for Client resource
d 	Wating for Maximum jobs
t 	Waiting for Start Time
p 	Waiting for higher priority job to finish

Misc. Commands

List all jobs (name only)

.jobs

Show status of a specific job (verbose)

status jobid=####

Test server's connection to a client

estimate     (then enter a number from the list)