You are on page 1of 5

2/28/2014

Bacula

Bacula
Bacula is a backup program enabling you to backup, restore, and verify data across your network. There are Bacula clients for Linux, Windows, and Mac OS X - making it a cross-platform network wide solution. Overview Installation Configuration Localhost Backup Resources

Overview
Bacula is made up of several components and services used to manage which files to backup and backup locations: 1. Bacula Director: a service that controls all backup, restore, verify, and archive operations. 2. Bacula Console: an application allowing communication with the Director. There are three versions of the Console: 1. Text based command line version. 2. Gnome based GTK+ Graphical User Interface (GUI) interface. 3. wxWidgets GUI interface. 3. Bacula File: also known as the Bacula Client program. This application is installed on machines to be backed up, and is responsible for the data requested by the Director. 4. Bacula Storage: the programs that perform the storage and recovery of data to the physical media. 5. Bacula Catalog: is responsible for maintaining the file indexes and volume databases for all files backed up, enabling quick location and restoration of archived files. The Catalog supports three different databases MySQL, PostgreSQL, and SQLite. 6. Bacula Monitor: allows the monitoring of the Director, File daemons, and Storage daemons. Currently the Monitor is only available as a GTK+ GUI application. These services and applications can be run on multiple servers and clients, or they can be installed on one machine if backing up a single disk or volume.

Installation
If using MySQL or PostgreSQL as your database, you should already have the services available. Bacula will not install them for you. There are multiple packages containing the different Bacula components. To install Bacula, from a terminal prompt enter: s u d oa p t g e ti n s t a l lb a c u l a
https://help.ubuntu.com/12.04/serverguide/bacula.html 1/5

2/28/2014

Bacula

By default installing the bacula package will use a MySQL database for the Catalog. If you want to use SQLite or PostgreSQL, for the Catalog, installbacula-director-sqlite3 or bacula-director-pgsql respectively. During the install process you will be asked to supply credentials for the database administrator and the bacula database owner. The database administrator will need to have the appropriate rights to create a database, see MySQL for more information.

Configuration
Bacula configuration files are formatted based on resources comprising of directives surrounded by {} braces. Each Bacula component has an individual file in the / e t c / b a c u l adirectory. The various Bacula components must authorize themselves to each other. This is accomplished using the password directive. For example, theStorage resource password in the / e t c / b a c u l a / b a c u l a d i r . c o n ffile must match the Director resource password in/ e t c / b a c u l a / b a c u l a s d . c o n f . By default the backup job named Client1 is configured to archive the Bacula Catalog. If you plan on using the server to backup more than one client you should change the name of this job to something more descriptive. To change the name edit / e t c / b a c u l a / b a c u l a d i r . c o n f : # #D e f i n et h em a i nn i g h t l ys a v eb a c k u pj o b # B yd e f a u l t ,t h i sj o bw i l lb a c ku pt od i s ki n J o b{ N a m e=" B a c k u p S e r v e r " J o b D e f s=" D e f a u l t J o b " W r i t eB o o t s t r a p=" / v a r / l i b / b a c u l a / C l i e n t 1 . b s r " } The example above changes the job name to BackupServer matching the machine's host name. Replace BackupServer with your appropriate hostname, or other descriptive name. The Console can be used to query the Director about jobs, but to use the Console with a non-root user, the user needs to be in the bacula group. To add a user to the bacula group enter the following from a terminal: s u d oa d d u s e r$ u s e r n a m eb a c u l a Replace $username with the actual username. Also, if you are adding the current user to the group you should log out and back in for the new permissions to take effect.

Localhost Backup
This section describes how to backup specified directories on a single host to a local tape drive. 1. First, the Storage device needs to be configured. Edit / e t c / b a c u l a / b a c u l a s d . c o n fadd: D e v i c e{ N a m e=" T a p eD r i v e " D e v i c eT y p e=t a p e
https://help.ubuntu.com/12.04/serverguide/bacula.html 2/5

2/28/2014

Bacula

M e d i aT y p e=D D S 4 A r c h i v eD e v i c e=/ d e v / s t 0 H a r d w a r ee n do fm e d i u m=N o ; A u t o m a t i c M o u n t=y e s ; #w h e nd e v i c eo p e n e d ,r e a di t A l w a y s O p e n=Y e s ; R e m o v a b l e M e d i a=y e s ; R a n d o m A c c e s s=n o ; A l e r tC o m m a n d=" s hc' t a p e i n f of% c|g r e pT a p e A l e r t ' " } The example is for a DDS-4 tape drive. Adjust the Media Type and Archive Device to match your hardware. You could also uncomment one of the other examples in the file. 2. After editing / e t c / b a c u l a / b a c u l a s d . c o n fthe Storage daemon will need to be restarted: s u d o/ e t c / i n i t . d / b a c u l a s dr e s t a r t 3. Now add a Storage resource in / e t c / b a c u l a / b a c u l a d i r . c o n fto use the new Device: #D e f i n i t i o no f" T a p eD r i v e "s t o r a g ed e v i c e S t o r a g e{ N a m e=T a p e D r i v e #D on o tu s e" l o c a l h o s t "h e r e A d d r e s s=b a c k u p s e r v e r #N . B .U s eaf u l l yq u a l i f i e dn a m eh e r e S D P o r t=9 1 0 3 P a s s w o r d=" C v 7 0 F 6 p f 1 t 6 p B o p T 4 v Q O n i g D r R 0 v 3 L T 3 C g k i y j c " D e v i c e=" T a p eD r i v e " M e d i aT y p e=t a p e } The Address directive needs to be the Fully Qualified Domain Name (FQDN) of the server. Change backupserver to the actual host name. Also, make sure the Password directive matches the password string in / e t c / b a c u l a / b a c u l a s d . c o n f . 4. Create a new FileSet, which will determine what directories to backup, by adding: #L o c a l h o s t B a c u pF i l e S e t . F i l e S e t{ N a m e=" L o c a l h o s t F i l e s " I n c l u d e{ O p t i o n s{ s i g n a t u r e=M D 5 c o m p r e s s i o n = G Z I P } F i l e=/ e t c F i l e=/ h o m e } } This FileSet will backup the / e t cand / h o m edirectories. The Options resource directives configure the FileSet to create an MD5 signature for each file backed up, and to compress the files using GZIP. 5. Next, create a new Schedule for the backup job: #L o c a l h o s t B a c k u pS c h e d u l e-D a i l y .
https://help.ubuntu.com/12.04/serverguide/bacula.html 3/5

2/28/2014

Bacula

S c h e d u l e{ N a m e=" L o c a l h o s t D a i l y " R u n=F u l ld a i l ya t0 0 : 0 1 } The job will run every day at 00:01 or 12:01 am. There are many other scheduling options available. 6. Finally create the Job: #L o c a l h o s tb a c k u p . J o b{ N a m e=" L o c a l h o s t B a c k u p " J o b D e f s=" D e f a u l t J o b " E n a b l e d=y e s L e v e l=F u l l F i l e S e t=" L o c a l h o s t F i l e s " S c h e d u l e=" L o c a l h o s t D a i l y " S t o r a g e=T a p e D r i v e W r i t eB o o t s t r a p=" / v a r / l i b / b a c u l a / L o c a l h o s t B a c k u p . b s r " } The job will do a Full backup every day to the tape drive. 7. Each tape used will need to have a Label. If the current tape does not have a label Bacula will send an email letting you know. To label a tape using the Console enter the following from a terminal: b c o n s o l e 8. At the Bacula Console prompt enter: l a b e l 9. You will then be prompted for the Storage resource:

A u t o m a t i c a l l ys e l e c t e dC a t a l o g :M y C a t a l o g U s i n gC a t a l o g" M y C a t a l o g " T h ed e f i n e dS t o r a g er e s o u r c e sa r e : 1 :F i l e 2 :T a p e D r i v e S e l e c tS t o r a g er e s o u r c e( 1 2 ) : 2

10. Enter the new Volume name:

E n t e rn e wV o l u m en a m e :S u n d a y D e f i n e dP o o l s : 1 :D e f a u l t 2 :S c r a t c h Replace Sunday with the desired label. 11. Now, select the Pool:
https://help.ubuntu.com/12.04/serverguide/bacula.html 4/5

2/28/2014

Bacula

S e l e c tt h eP o o l( 1 2 ) :1 C o n n e c t i n gt oS t o r a g ed a e m o nT a p e D r i v ea tb a c k u p s e r v e r : 9 1 0 3. . . S e n d i n gl a b e lc o m m a n df o rV o l u m e" S u n d a y "S l o t0. . .

Congratulations, you have now configured Bacula to backup the localhost to an attached tape drive.

Resources
1. For more Bacula configuration options refer to the Bacula User's Manual 2. The Bacula Home Page contains the latest Bacula news and developments. 3. Also, see the Bacula Ubuntu Wiki page.

https://help.ubuntu.com/12.04/serverguide/bacula.html

5/5

You might also like