User Tools

Site Tools


bacula_manual:getting_started_with_bacula

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
bacula_manual:getting_started_with_bacula [2010/02/05 01:04]
baylink Clean, expand, and fluff
bacula_manual:getting_started_with_bacula [2010/03/06 06:22] (current)
markusn link to chapter
Line 25: Line 25:
  
 ===== Understanding Pools, Volumes and Labels ===== ===== 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. ​+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.  It's important to understand them, though, as they allow you to exercise the full power of Bacula to back up your systems automatically.
  
-  * A Volume is a single physical tape (or possibly a single file) on which Bacula will write your backup data. +  * A Volume is a single physical tape (or possibly a single file) on which Bacula will write your backup data.  ​Bacula labels volumes so it can identify them, and look up the files backed up on them in its Catalog.  ​
  
-  * Pools group together Volumes so that a backup is not restricted to the length of a single Volume (tape). ​+  * 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 will specify a Pool, and Bacula will select the next appendable Volume - generally, the next volume it does not think is full - from the Pool and request you to mount it, if it is not mounted already.
  
-Consequently,​ rather than explicitly naming Volumes ​in your Job, you specify a Pool, and Bacula will select ​the next appendable Volume ​from the Pool and request you to mount it.+Although the Pool options are specified ​in the Director'​s ​Pool resource, the Pool is actually maintained in the Bacula Catalog. It contains information taken from the Pool configuration resource (bacula-dir.conf) as well as information on all the Volumes that have been added to the PoolAdding Volumes to a Pool is usually done manually with the Console program using the label command. ​ (CHECKME: how is creation of Volumes on diskfiles handled?)
  
-Although the basic Pool options are specified in the Director'​s Pool resource, the real Pool is maintained in the Bacula Catalog. It contains information taken from the Pool resource (bacula-dir.conf) as well as information on all the Volumes that have been added to the Pool. Adding Volumes to a Pool is usually done manually with the Console program using the label command. +For each Volume, Bacula maintains a fair amount of catalog information such as the first write date/​time ​(FIXME: is this start, end, or both?), the most recent ​write date/time, the number of files on the Volume, the number of bytes on the Volume, the number of Mounts, etc.
- +
-For each Volume, Bacula maintains a fair amount of catalog information such as the first write date/time, the last write date/time, the number of files on the Volume, the number of bytes on the Volume, the number of Mounts, etc.+
  
 Before Bacula will read or write a Volume, the physical Volume must have a Bacula software label so that Bacula can be sure the correct Volume is mounted. This is usually done using the label command in the Console program. Before Bacula will read or write a Volume, the physical Volume must have a Bacula software label so that Bacula can be sure the correct Volume is mounted. This is usually done using the label command in the Console program.
Line 45: Line 43:
  
 ===== Setting Up Bacula Configuration Files ===== ===== Setting Up Bacula Configuration Files =====
-After running the appropriate ./configure command and doing a make, and a make install, if this is the first time you are running Bacula, you must create valid configuration files for the Director, the File daemon, the Storage daemon, and the Console programs. If you have followed our recommendations,​ default configuration files as well as the daemon binaries will be located in your installation directory. In any case, the binaries are found in the directory you specified on the --sbindir option to the ./configure command, and the configuration files are found in the directory you specified on the --sysconfdir option.+After installing a back-end RPM package, and optionally the matching -client and -bat RPMs for your distribution (or running the appropriate ./configure command and doing a make, and a make install, ​if you're installing from source or SRPM), and if this is the first time you are running Bacula ​on this machine, you must create valid configuration files for the Director, the local File daemon, the Storage daemon, and the Console programs. 
 + 
 +If you have followed our recommendations ​for building and installing from source, default configuration files as well as the daemon binaries will be located in your installation directory. In any case, the binaries are found in the directory you specified on the --sbindir option to the ./configure command, and the configuration files are found in the directory you specified on the --sysconfdir option
 + 
 +If you installed a binary package, you can run rpm -qpl on the RPM file to find out where these files have been put during installation,​ generally config files in /​etc/​bacula,​ binaries in /​usr/​sbin/​bacula,​ and documentation in /​usr/​share/​doc/​bacula on Linux systems, along with initscripts,​ logwatch and logrotate stubs, and other such distribution support files in the prescribed places.
  
 When initially setting up Bacula you will need to invest a bit of time in modifying the default configuration files to suit your environment. This may entail starting and stopping Bacula a number of times until you get everything right. Please do not despair. Once you have created your configuration files, you will rarely need to change them nor will you stop and start Bacula very often. Most of the work will simply be in changing the tape when it is full. When initially setting up Bacula you will need to invest a bit of time in modifying the default configuration files to suit your environment. This may entail starting and stopping Bacula a number of times until you get everything right. Please do not despair. Once you have created your configuration files, you will rarely need to change them nor will you stop and start Bacula very often. Most of the work will simply be in changing the tape when it is full.
Line 52: Line 54:
 The Console program is used by the administrator to interact with the Director and to manually start/stop Jobs or to obtain Job status information. The Console program is used by the administrator to interact with the Director and to manually start/stop Jobs or to obtain Job status information.
  
-The Console configuration file is found in the directory specified on the --sysconfdir option that you specified on the ./configure command and by default is named bconsole.conf.+The Console configuration file is found in the directory specified on the --sysconfdir option that you specified on the ./configure command ​(or in /etc/bacula for binary installs) ​and by default is named bconsole.conf.
  
 If you choose to build the GNOME console with the --enable-gnome option, you also find a default configuration file for it, named bgnome-console.conf. If you choose to build the GNOME console with the --enable-gnome option, you also find a default configuration file for it, named bgnome-console.conf.
Line 70: Line 72:
 The image shows a tray-monitor configured for three daemons. By clicking on the radio buttons in the upper left corner of the image, you can see the status for each of the daemons. The image shows the status for the Storage daemon (MainSD) that is currently selected. The image shows a tray-monitor configured for three daemons. By clicking on the radio buttons in the upper left corner of the image, you can see the status for each of the daemons. The image shows the status for the Storage daemon (MainSD) that is currently selected.
  
-The Monitor configuration file is found in the directory specified on the --sysconfdir option that you specified on the ./configure command and by default is named tray-monitor.conf. Normally, for first time users, you just need to change the permission of this file to allow non-root users to run the Monitor, as this application must run as the same user as the graphical environment (don't forget to allow non-root users to execute bacula-tray-monitor). This is not a security problem as long as you use the default settings.+The Monitor configuration file is found in the directory specified on the --sysconfdir option that you specified on the ./configure command ​(or in /etc/bacula for binary installs) ​and by default is named tray-monitor.conf. Normally, for first time users, you just need to change the permission of this file to allow non-root users to run the Monitor, as this application must run as the same user as the graphical environment (don't forget to allow non-root users to execute bacula-tray-monitor). This is not a security problem as long as you use the default settings.
  
 More information is in the Monitor configuration chapter. More information is in the Monitor configuration chapter.
Line 77: Line 79:
 The File daemon is a program that runs on each (Client) machine. At the request of the Director, finds the files to be backed up and sends them (their data) to the Storage daemon. The File daemon is a program that runs on each (Client) machine. At the request of the Director, finds the files to be backed up and sends them (their data) to the Storage daemon.
  
-The File daemon configuration file is found in the directory specified on the --sysconfdir option that you specified on the ./configure command. By default, the File daemon'​s configuration file is named bacula-fd.conf. Normally, for first time users, no change is needed to this file. Reasonable defaults are set. However, if you are going to back up more than one machine, you will need to install the File daemon ​with a unique configuration file on each machine to be backed up. The information about each File daemon must appear in the Director'​s configuration file.+The File daemon configuration file is found in the directory specified on the --sysconfdir option that you specified on the ./configure command ​(or in /etc/bacula for binary installs). ​ On Windows binary installs, it will be in FIXME. By default, the File daemon'​s configuration file is named bacula-fd.conf. Normally, for first time users, no change is needed to this file. Reasonable defaults are set. However, if you are going to back up more than one machine, you will need to install the File daemon, and a unique configuration fileon each machine to be backed up. The information about each File daemon must appear in the Director'​s configuration file.
  
 Further details are in the File daemon configuration chapter. Further details are in the File daemon configuration chapter.
Line 84: Line 86:
 The Director is the central control program for all the other daemons. It schedules and monitors all jobs to be backed up. The Director is the central control program for all the other daemons. It schedules and monitors all jobs to be backed up.
  
-The Director configuration file is found in the directory specified on the --sysconfdir option that you specified on the ./configure command. Normally the Director'​s configuration file is named bacula-dir.conf.+The Director configuration file is found in the directory specified on the --sysconfdir option that you specified on the ./configure command ​(or in /etc/bacula for binary installs). Normally the Director'​s configuration file is named bacula-dir.conf.
  
-In general, the only change you must make is modify the FileSet resource so that the Include configuration directive contains at least one line with a valid name of a directory (or file) to be saved.+In general, the only change you must make is to modify the FileSet resource so that the Include configuration directive contains at least one line with a valid name of a directory (or file) to be saved.
  
-If you do not have a DLT tape drive, you will probably want to edit the Storage resource to contain names that are more representative of your actual storage device. You can always use the existing names as you are free to arbitrarily assign them, but they must agree with the corresponding names in the Storage daemon'​s configuration file.+If you do not have a DLT tape drive, you will probably want to edit the Storage resource to contain names that are more representative of your actual storage device. You can always use the existing namesas you are free to arbitrarily assign them, but they must agree with the corresponding names in the Storage daemon'​s configuration file.
  
-You may also want to change the email address for notification from the default root to your email address.+You may also want to change the email address for notification from the default root to your email address.  Even better is to aim it at a "​role"​ account (backups@yourdomain.com),​ and allow your email system to forward that to whomever needs to be notified, which might be a list.
  
 Finally, if you have multiple systems to be backed up, you will need a separate File daemon or Client specification for each system, specifying its name, address, and password. We have found that giving your daemons the same name as your system but post fixed with -fd helps a lot in debugging. That is, if your system name is foobaz, you would give the File daemon the name foobaz-fd. For the Director, you should use foobaz-dir, and for the storage daemon, you might use foobaz-sd. Each of your Bacula components must have a unique name. If you make them all the same, aside from the fact that you will not know what daemon is sending what message, if they share the same working directory, the daemons temporary file names will not be unique, and you will get many strange failures. Finally, if you have multiple systems to be backed up, you will need a separate File daemon or Client specification for each system, specifying its name, address, and password. We have found that giving your daemons the same name as your system but post fixed with -fd helps a lot in debugging. That is, if your system name is foobaz, you would give the File daemon the name foobaz-fd. For the Director, you should use foobaz-dir, and for the storage daemon, you might use foobaz-sd. Each of your Bacula components must have a unique name. If you make them all the same, aside from the fact that you will not know what daemon is sending what message, if they share the same working directory, the daemons temporary file names will not be unique, and you will get many strange failures.
Line 97: Line 99:
  
 ==== Configuring the Storage daemon ==== ==== Configuring the Storage daemon ====
-The Storage daemon is responsible,​ at the Director'​s request, for accepting data from a File daemon and placing it on Storage media, or in the case of a restore request, ​to find the data and send it to the File daemon.+The Storage daemon is responsible,​ at the Director'​s request, for accepting data from a File daemon and placing it on Storage media, or in the case of a restore request, ​for finding ​the data and sending ​it to the File daemon.
  
-The Storage daemon'​s configuration file is found in the directory specified on the --sysconfdir option that you specified on the ./configure command. By default, the Storage daemon'​s file is named bacula-sd.conf. Edit this file to contain the correct Archive device names for any tape devices that you have. If the configuration process properly detected your system, they will already be correctly set. These Storage resource name and Media Type must be the same as the corresponding ones in the Director'​s configuration file bacula-dir.conf. If you want to backup to a file instead of a tape, the Archive device must point to a directory in which the Volumes will be created as files when you label the Volume.+The Storage daemon'​s configuration file is found in the directory specified on the --sysconfdir option that you specified on the ./configure command ​(or in /etc/bacula for binary installs). By default, the Storage daemon'​s file is named bacula-sd.conf. Edit this file to contain the correct Archive device names for any tape devices that you have. If the configuration process properly detected your system, they will already be correctly set. These Storage resource name and Media Type must be the same as the corresponding ones in the Director'​s configuration file bacula-dir.conf. 
 + 
 +If you want to backup to disk files instead of a tape, the Archive device must point to a directory in which the Volumes will be created as files when you label the Volume. ​(FIXME: this needs to be expanded to explain exactly how this works, unless that's covered later.)
  
 Further information is in the Storage daemon configuration chapter. Further information is in the Storage daemon configuration chapter.
Line 119: Line 123:
 </​code>​ </​code>​
  
-will test the configuration files of each of the main programs. If the configuration file is OK, the program will terminate without printing anything. Please note that, depending on the configure options you choose, some, or even all, of the three last commands will not be available on your system. If you have installed ​the binaries in traditional Unix locations rather than single file, you will need to modify the above commands appropriately (no ./ in front of the command name, and a path in front of the conf file name).+will test the configuration files of each of the main programs. If the configuration file is OK, the program will terminate without printing anything. Please note that, depending on the configure options you choose, some, or even all, of the three last commands will not be available on your system. If you'​ve ​installed ​from binary package instead of course, you can use this:
  
 +<code bash>
 +cd /etc/bacula
 +bacula-dir -t -c bacula-dir.conf
 +bacula-fd -t -c bacula-fd.conf
 +bacula-sd -t -c bacula-sd.conf
 +bconsole -t -c bconsole.conf
 +bgnome-console -t -c bgnome-console.conf
 +bwx-console -t -c bwx-console.conf
 +bat -t -c bat.conf
 +su <normal user> -c "/​usr/​sbin/​bacula-tray-monitor -t -c tray-monitor.conf"​
 +</​code>​
 +
 +and, in fact, you might want to put that in a shellscript,​ so you can run it whenever you make changes. ​ Baylink calls his bcheck(1l), a command name which used to point to a file system check program, but that was Long, Long Ago.
 +
 +Note that the binaries live in /usr/sbin on Linux binary installs, so you must be root to run this, or add /usr/sbin to your path.
  
 ===== Testing Compatibility with Your Tape Drive ===== ===== Testing Compatibility with Your Tape Drive =====
-Before spending a lot of time on Bacula only to find that it doesn'​t work with your tape drive, please read the btape -- Testing Your Tape Drive chapter of this manual. If you have a modern standard SCSI tape drive on a Linux or Solaris, most likely it will work, but better test than be sorry. For FreeBSD (and probably other xBSD flavors), reading the above mentioned tape testing chapter is a must. Also, for FreeBSD, please see The FreeBSD Diary for a detailed description on how to make Bacula work on your system. In addition, users of FreeBSD prior to 4.9-STABLE dated Mon Dec 29 15:18:01 2003 UTC who plan to use tape devices, please see the file platforms/​freebsd/​pthreads-fix.txt in the main Bacula directory concerning important information concerning compatibility of Bacula and your system.+Before spending a lot of time on Bacula only to find that it doesn'​t work with your tape drive, please read the btape -- [[Testing Your Tape Drive With Bacula]] ​chapter of this manual. If you have a modern standard SCSI tape drive on a Linux or Solaris, most likely it will work, but better test than be sorry. For FreeBSD (and probably other xBSD flavors), reading the above mentioned tape testing chapter is a must. Also, for FreeBSD, please see The FreeBSD Diary for a detailed description on how to make Bacula work on your system. In addition, users of FreeBSD prior to 4.9-STABLE dated Mon Dec 29 15:18:01 2003 UTC who plan to use tape devices, please see the file platforms/​freebsd/​pthreads-fix.txt in the main Bacula directory concerning important information concerning compatibility of Bacula and your system.
  
 ===== Get Rid of the /lib/tls Directory ===== ===== Get Rid of the /lib/tls Directory =====
Line 133: Line 152:
 Probably the most important part of running Bacula is being able to restore files. If you haven'​t tried recovering files at least once, when you actually have to do it, you will be under a lot more pressure, and prone to make errors, than if you had already tried it once. Probably the most important part of running Bacula is being able to restore files. If you haven'​t tried recovering files at least once, when you actually have to do it, you will be under a lot more pressure, and prone to make errors, than if you had already tried it once.
  
-To get a good idea how to use Bacula in a short time, we strongly recommend that you follow the example in the Running Bacula ​Chapter ​of this manual where you will get detailed instructions on how to run Bacula.+To get a good idea how to use Bacula in a short time, we strongly recommend that you follow the example in the Running Bacula ​chapter ​of this manual where you will get detailed instructions on how to run Bacula.
  
 ===== Log Rotation ===== ===== Log Rotation =====
  
 If you use the default bacula-dir.conf or some variation of it, you will note that it logs all the Bacula output to a file. To avoid that this file grows without limit, we recommend that you copy the file logrotate from the scripts/​logrotate to /​etc/​logrotate.d/​bacula. This will cause the log file to be rotated once a month and kept for a maximum of five months. You may want to edit this file to change the default log rotation preferences. If you use the default bacula-dir.conf or some variation of it, you will note that it logs all the Bacula output to a file. To avoid that this file grows without limit, we recommend that you copy the file logrotate from the scripts/​logrotate to /​etc/​logrotate.d/​bacula. This will cause the log file to be rotated once a month and kept for a maximum of five months. You may want to edit this file to change the default log rotation preferences.
 +
 +Installations from binary packages will automatically install this file.
  
 ===== Log Watch ===== ===== Log Watch =====
  
 Some systems such as Red Hat and Fedora run the logwatch program every night, which does an analysis of your log file and sends an email report. If you wish to include the output from your Bacula jobs in that report, please look in the scripts/​logwatch directory. The README file in that directory gives a brief explanation on how to install it and what kind of output to expect. Some systems such as Red Hat and Fedora run the logwatch program every night, which does an analysis of your log file and sends an email report. If you wish to include the output from your Bacula jobs in that report, please look in the scripts/​logwatch directory. The README file in that directory gives a brief explanation on how to install it and what kind of output to expect.
 +
 +Installations from binary packages will automatically install this file.
  
 ===== Disaster Recovery ===== ===== Disaster Recovery =====
bacula_manual/getting_started_with_bacula.1265331879.txt.gz · Last modified: 2010/02/05 01:04 (external edit)