Bacula Installation and Configuration Guide
Total Page:16
File Type:pdf, Size:1020Kb
Bacula Installation and Configuration Guide It comes in the night and sucks the essence from your computers. Kern Sibbald May 5, 2010 This manual documents Bacula version 3.0.3a (06 December 2009) Copyright c 1999-2009, Free Software Foundation Europe e.V. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled ”GNU Free Documentation License”. 2 Contents 1 Getting Started with Bacula 5 1.1 UnderstandingJobsandSchedules . .............. 5 1.2 Understanding Pools, Volumes and Labels . ................ 5 1.3 SettingUpBaculaConfigurationFiles . ............... 6 1.3.1 ConfiguringtheConsoleProgram. ........... 6 1.3.2 ConfiguringtheMonitorProgram . .......... 7 1.3.3 ConfiguringtheFiledaemon . ......... 7 1.3.4 ConfiguringtheDirector. .......... 8 1.3.5 ConfiguringtheStoragedaemon . .......... 8 1.4 TestingyourConfigurationFiles . .............. 9 1.5 Testing Compatibility with Your Tape Drive. ................. 9 1.6 GetRidofthe/lib/tlsDirectory . .............. 9 1.7 RunningBacula................................... ......... 9 1.8 LogRotation ..................................... ........ 10 1.9 LogWatch ........................................ ...... 10 1.10 DisasterRecovery. .. ............ 10 2 Installing Bacula 11 2.1 SourceReleaseFiles .............................. ........... 11 2.2 UpgradingBacula ................................. ......... 12 2.3 ReleasesNumbering ............................... .......... 13 2.4 DependencyPackages .............................. .......... 14 2.5 SupportedOperatingSystems. ............. 15 2.6 BuildingBaculafromSource . ............ 15 2.7 WhatDatabasetoUse? .............................. ......... 18 2.8 QuickStart ...................................... ........ 18 3 4 CONTENTS 2.9 ConfigureOptions ................................. ......... 18 2.10 RecommendedOptionsforMostSystems . .............. 24 2.11RedHat......................................... ....... 25 2.12Solaris........................................ ......... 25 2.13FreeBSD........................................ ........ 26 2.14Win32.......................................... ....... 27 2.15 OneFileConfigureScript . ............ 27 2.16 InstallingBacula ............................... ............ 27 2.17 BuildingaFileDaemonorClient . .............. 27 2.18 AutoStartingtheDaemons . ............ 28 2.19OtherMakeNotes ................................. ......... 28 2.20 InstallingTrayMonitor . ............. 29 2.20.1 GNOME ........................................ 30 2.20.2 KDE.......................................... 30 2.20.3 Otherwindowmanagers . ......... 30 2.21 Modifying the Bacula Configuration Files . ................. 30 3 Critical Items to Implement Before Production 31 3.1 CriticalItems................................... .......... 31 3.2 RecommendedItems ................................ ......... 32 4 Customizing the Configuration Files 33 4.1 CharacterSets ................................... ......... 34 4.2 ResourceDirectiveFormat. ............. 35 4.2.1 Comments...................................... ..... 35 4.2.2 UpperandLowerCaseandSpaces . ......... 35 4.2.3 IncludingotherConfigurationFiles . .............. 35 4.2.4 RecognizedPrimitiveDataTypes. ............ 36 4.3 ResourceTypes................................... ......... 37 4.4 Names,PasswordsandAuthorization. ............... 37 4.5 DetailedInformationforeachDaemon . ............... 38 5 Configuring the Director 39 5.1 DirectorResourceTypes. ............ 39 5.2 TheDirectorResource ............................. ........... 40 CONTENTS 5 5.3 TheJobResource .................................. ........ 42 5.4 TheJobDefsResource .............................. .......... 56 5.5 TheScheduleResource. ........... 56 5.6 TechnicalNotesonSchedules . ............. 59 5.7 TheFileSetResource.............................. ........... 59 5.8 FileSetExamples................................. .......... 70 5.9 BackingupRawPartitions . ........... 75 5.10 ExcludingFilesandDirectories . ................ 75 5.11 WindowsFileSets................................ ........... 75 5.12 TestingYourFileSet . ............ 77 5.13 TheClientResource .............................. ........... 78 5.14 TheStorageResource . .. ........... 79 5.15ThePoolResource ................................ .......... 81 5.15.1 TheScratchPool............................... ........ 87 5.16 TheCatalogResource . ........... 87 5.17 TheMessagesResource . ........... 88 5.18 TheConsoleResource . ........... 88 5.19 TheCounterResource . ........... 89 5.20 ExampleDirectorConfigurationFile . ................ 90 6 Client/File daemon Configuration 93 6.1 TheClientResource ............................... .......... 93 6.2 TheDirectorResource ............................. ........... 95 6.3 TheMessageResource .............................. .......... 96 6.4 ExampleClientConfigurationFile . .............. 96 7 Storage Daemon Configuration 97 7.1 StorageResource ................................. .......... 97 7.2 DirectorResource................................ ........... 99 7.3 DeviceResource .................................. ......... 99 7.4 Edit Codes for Mount and Unmount Directives . ...............107 7.5 Devicesthatrequireamount(DVD) . ............. 107 8 Autochanger Resource 109 8.1 Capabilities .................................... .......... 110 6 CONTENTS 8.2 MessagesResource ................................ .......... 110 8.3 SampleStorageDaemonConfigurationFile . ...............110 9 Messages Resource 113 10 Console Configuration 117 10.1General ........................................ ........ 117 10.2 TheDirectorResource . ............ 117 10.3 TheConsoleFontResource. ............. 118 10.4 TheConsoleResource . ........... 118 10.5 ConsoleCommands................................ .......... 120 10.6 SampleConsoleConfigurationFile . ...............120 11 Monitor Configuration 121 11.1 TheMonitorResource . ........... 121 11.2 TheDirectorResource . ............ 121 11.3 TheClientResource .............................. ........... 122 11.4 TheStorageResource . .. ........... 122 11.5 TrayMonitorSecurity . ............ 123 11.6 SampleTrayMonitorconfiguration . ...............123 11.6.1 Sample File daemon’s Director record. ...............124 11.6.2 Sample Storage daemon’s Director record. ................124 11.6.3 SampleDirector’sConsolerecord. .............. 124 12 Bacula Security Issues 125 12.1 BackwardCompatibility . ............. 126 12.2 ConfiguringandTestingTCPWrappers . .............. 126 12.3 Runningasnon-root .............................. ........... 128 Chapter 1 Getting Started with Bacula If you are like me, you want to get Bacula running immediately to get a feel for it, then later you want to go back and read about all the details. This chapter attempts to accomplish just that: get you going quickly without all the details. If you want to skip the section on Pools, Volumes and Labels, you can always come back to it, but please read to the end of this chapter, and in particular follow the instructions for testing your tape drive. We assume that you have managed to build and install Bacula, if not, you might want to first look at the System Requirements then at the Compiling and Installing Bacula chapter of this manual. 1.1 Understanding Jobs and Schedules In order to make Bacula as flexible as possible, the directions given to Bacula are specified in several pieces. The main instruction is the job resource, which defines a job. A backup job generally consists of a FileSet, a Client, a Schedule for one or several levels or times of backups, a Pool, as well as additional instructions. Another way of looking at it is the FileSet is what to backup; the Client is who to backup; the Schedule defines when, and the Pool defines where (i.e. what Volume). Typically one FileSet/Client combination will have one corresponding job. Most of the directives, such as FileSets, Pools, Schedules, can be mixed and matched among the jobs. So you might have two different Job definitions (resources) backing up different servers using the same Schedule, the same Fileset (backing up the same directories on two machines) and maybe even the same Pools. The Schedule will define what type of backup will run when (e.g. Full on Monday, incremental the rest of the week), and when more than one job uses the same schedule, the job priority determines which actually runs first. If you have a lot of jobs, you might want to use JobDefs, where you can set defaults for the jobs, which can then be changed in the job resource, but this saves rewriting the identical parameters for each job. In addition to the FileSets you want to back up, you should also have a job that backs up your catalog. Finally, be aware that in addition to the backup jobs there are restore, verify, and admin jobs, which have different requirements. 1.2 Understanding Pools, Volumes and Labels If you have been using a program such as tar to backup your system, Pools, Volumes, and labeling may be a bit confusing at first. A Volume is a single physical tape (or possibly a single file) on which Bacula will write your backup data. Pools group together Volumes so that a backup is not restricted to the length of a single Volume (tape). Consequently, rather than explicitly naming Volumes in your Job, you specify a Pool, and Bacula will select the