特殊:Badtitle/NS100:Bacula:修订间差异

来自Ubuntu中文
跳到导航跳到搜索
Wikibot留言 | 贡献
无编辑摘要
Wikibot留言 | 贡献
无编辑摘要
第9行: 第9行:
* '''Bacula Director''' -- service that controls all backup, restore, verify, and archive operations.
* '''Bacula Director''' -- service that controls all backup, restore, verify, and archive operations.
* '''Bacula Console''' -- application allowing communication with the Director.  There are three versions of the Console:  
* '''Bacula Console''' -- application allowing communication with the Director.  There are three versions of the Console:  
* Text based command line version.
** Text based command line version.
* Gnome based gtk+ GUI interface.
** Gnome based gtk+ GUI interface.
* wxWidgets interface GUI interface.
** wxWidgets interface GUI interface.
* '''Bacula File''' -- also known as the Bacula Client program.  Installed on machines to be backed up, and is responsible for the data requested by the Director.
* '''Bacula File''' -- also known as the Bacula Client program.  Installed on machines to be backed up, and is responsible for the data requested by the Director.
* '''Bacula Storage''' -- the programs that perform the storage and recovery of data to the physical media.  
* '''Bacula Storage''' -- the programs that perform the storage and recovery of data to the physical media.  
* '''Bacula Catalog''' -- responsible for maintaining the file indexes and volume databases for all files backed up.  The catalog enables quick location and restoration of archived files.  The Catalog supports three different databases MySQL, [[UbuntuHelp:PostgreSQL|PostgreSQL]], and SQLite.
* '''Bacula Catalog''' -- responsible for maintaining the file indexes and volume databases for all files backed up.  The catalog enables quick location and restoration of archived files.  The Catalog supports three different databases MySQL, PostgreSQL, and SQLite.
* '''Bacula Monitor''' -- allows the monitoring of the Director, File daemons, and Storage daemons.  Currently the Monitor is only available as a GTK+ GUI application.
* '''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.
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 ==
== Installation ==
There are multiple packages containing the different '''Bacula''' components. Currently the Bacula packages are in the Universe repository, but work is being done to get the core packages into the Main repository.   
There are multiple packages containing the different '''Bacula''' components. Currently the Bacula packages are in the Universe repository, but work is being done to get the core packages into the Main repository.   
By default installing the '''bacula''' package will install the '''bacula-director-sqlite3''' package which will use '''SQLite''' for the Catalog.  If you want to use '''MySQL''' or '''[[UbuntuHelp:PostgreSQL|PostgreSQL]]''' for the catalog install '''bacula-director-mysql''' or '''bacula-director-pgsql''' respectively.
By default installing the '''bacula''' package will install the '''bacula-director-sqlite3''' package which will use '''SQLite''' for the Catalog.  If you want to use '''MySQL''' or '''PostgreSQL''' for the catalog install '''bacula-director-mysql''' or '''bacula-director-pgsql''' respectively. '''NOTE:''' as of Karmic (Ubuntu 9.10) the default database backend is mysql.  
See [[UbuntuHelp:InstallingSoftware|InstallingSoftware]] for information on repositories and using package managers.
See InstallingSoftware for information on repositories and using package managers.
After installing Bacula the <code><nowiki>bacula-sd</nowiki></code> daemon may have an issue starting because there is no storage device configured.  A work around for this error is to configure an '''Archive Device''' in the <code><nowiki>/etc/bacula/bacula-sd.conf</nowiki></code> file, and enter the following '''apt''' command to complete the package install:
After installing Bacula the <code><nowiki>bacula-sd</nowiki></code> daemon may have an issue starting because there is no storage device configured.  A work around for this error is to configure an '''Archive Device''' in the <code><nowiki>/etc/bacula/bacula-sd.conf</nowiki></code> file, and enter the following '''apt''' command to complete the package install:
<pre><nowiki>
<pre><nowiki>
sudo apt-get install -f
sudo apt-get install -f
</nowiki></pre>
</nowiki></pre>
Bacula also requires a Mail Transfer Agent (MTA).  The default Ubuntu MTA is '''Postfix''', but it is possible to use another MTA such as Exim4.  For details on setting up Postfix see [[UbuntuHelp:Postfix|Postfix]]
Bacula also requires a Mail Transfer Agent (MTA).  The default Ubuntu MTA is '''Postfix''', but it is possible to use another MTA such as Exim4.  For details on setting up Postfix see [[Postfix]]
== Configuration ==
== Configuration ==
Bacula configuration files are formatted based on '''resources''' comprising of '''directives''' surrounded by "{}" braces.  The files are located in the  
Bacula configuration files are formatted based on '''resources''' comprising of '''directives''' surrounded by "{}" braces.  The files are located in the  
第36行: 第36行:
#  By default, this job will back up to disk in  
#  By default, this job will back up to disk in  
Job {
Job {
  Name = "BackupServer"
Name = "BackupServer"
  JobDefs = "DefaultJob"
JobDefs = "DefaultJob"
  Write Bootstrap = "/var/lib/bacula/Client1.bsr"
Write Bootstrap = "/var/lib/bacula/Client1.bsr"
}
}
</nowiki></pre>
</nowiki></pre>
第52行: 第52行:
<pre><nowiki>
<pre><nowiki>
Device {
Device {
  Name = "Tape Drive"
Name = "Tape Drive"
  Device Type = tape
Device Type = tape
  Media Type = DDS-4
Media Type = DDS-4
  Archive Device = /dev/st0
Archive Device = /dev/st0
  Hardware end of medium = No;
Hardware end of medium = No;
  AutomaticMount = yes;              # when device opened, read it
AutomaticMount = yes;              # when device opened, read it
  AlwaysOpen = Yes;
AlwaysOpen = Yes;
  RemovableMedia = yes;
RemovableMedia = yes;
  RandomAccess = no;
RandomAccess = no;
  Alert Command = "sh -c 'tapeinfo -f %c | grep TapeAlert'"
Alert Command = "sh -c 'tapeinfo -f %c | grep TapeAlert'"
}
}
</nowiki></pre>
</nowiki></pre>
第74行: 第74行:
# Definition of "Tape Drive" storage device
# Definition of "Tape Drive" storage device
Storage {
Storage {
  Name = TapeDrive
Name = TapeDrive
  # Do not use "localhost" here     
# Do not use "localhost" here     
  Address = backupserver              # N.B. Use a fully qualified name here
Address = backupserver              # N.B. Use a fully qualified name here
  SDPort = 9103
SDPort = 9103
  Password = "Cv70F6pf1t6pBopT4vQOnigDrR0v3LT3Cgkiyj"
Password = "Cv70F6pf1t6pBopT4vQOnigDrR0v3LT3Cgkiyj"
  Device = "Tape Drive"
Device = "Tape Drive"
  Media Type = tape
Media Type = tape
}
}
</nowiki></pre>
</nowiki></pre>
第89行: 第89行:
# LocalhostBacup FileSet.
# LocalhostBacup FileSet.
FileSet {
FileSet {
  Name = "LocalhostFiles"
Name = "LocalhostFiles"
  Include {
Include {
    Options {
Options {
      signature = MD5
signature = MD5
      compression=GZIP
compression=GZIP
    }
}
    File = /etc
File = /etc
    File = /home
File = /home
  }
}
}
}
</nowiki></pre>
</nowiki></pre>
第105行: 第105行:
# LocalhostBackup Schedule -- Daily.
# LocalhostBackup Schedule -- Daily.
Schedule {
Schedule {
  Name = "LocalhostDaily"
Name = "LocalhostDaily"
  Run = Full daily at 00:01
Run = Full daily at 00:01
}
}
</nowiki></pre>
</nowiki></pre>
第114行: 第114行:
# Localhost backup.
# Localhost backup.
Job {
Job {
  Name = "LocalhostBackup"
Name = "LocalhostBackup"
  JobDefs = "DefaultJob"
JobDefs = "DefaultJob"
  Enabled = yes
Enabled = yes
  Level = Full
Level = Full
  FileSet = "LocalhostFiles"
FileSet = "LocalhostFiles"
  Schedule = "LocalhostDaily"
Schedule = "LocalhostDaily"
  Storage = TapeDrive
Storage = TapeDrive
  Write Bootstrap = "/var/lib/bacula/LocalhostBackup.bsr"
Write Bootstrap = "/var/lib/bacula/LocalhostBackup.bsr"
}   
}   
</nowiki></pre>
</nowiki></pre>
第138行: 第138行:
Using Catalog "MyCatalog"
Using Catalog "MyCatalog"
The defined Storage resources are:
The defined Storage resources are:
    1: File
1: File
    2: TapeDrive
2: TapeDrive
Select Storage resource (1-2): 2
Select Storage resource (1-2): 2
</nowiki></pre>
</nowiki></pre>
第146行: 第146行:
Enter new Volume name: Sunday
Enter new Volume name: Sunday
Defined Pools:
Defined Pools:
    1: Default
1: Default
    2: Scratch
2: Scratch
</nowiki></pre>
</nowiki></pre>
* Select the '''Pool''':
* Select the '''Pool''':
第155行: 第155行:
Sending label command for Volume "Sunday" Slot 0 ...
Sending label command for Volume "Sunday" Slot 0 ...
</nowiki></pre>
</nowiki></pre>
== Notes ==
By using the apt-get command we are downloading the available build from Ubuntu universe.
For karmic you can check the version available at http://packages.ubuntu.com/karmic/admin/ (at time of writting it was version 2.4.4-1ubuntu9 and in source there is up to verison 5)
== Resources ==
== Resources ==
* [http://www.bacula.org/en/rel-manual/index.html Bacula Manual]
* [[http://www.bacula.org/en/rel-manual/index.html|Bacula Manual]]
* [http://www.bacula.org/en/ Bacula Home Page]
* [[http://www.bacula.org/en/|Bacula Home Page]]
----
----
[[category:CategoryBackupRecovery]]
[[category:CategoryBackupRecovery]]


[[category:UbuntuHelp]]
[[category:UbuntuHelp]]

2010年5月19日 (三) 16:51的版本

{{#ifexist: :Bacula/zh | | {{#ifexist: Bacula/zh | | {{#ifeq: {{#titleparts:Bacula|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:Bacula|1|-1|}} | zh | | }}

Introduction

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 OSX. Making it a cross platform network wide solution. There is an official documentation about Bacula here : https://help.ubuntu.com/8.04/serverguide/C/bacula.html List of graphical confiuration tools : http://www.bacula.org/en/rel-manual/GUI_Programs.html

Overview

Bacula is made up of several components and services used to manage what to backup and where to back it up to:

  • Bacula Director -- service that controls all backup, restore, verify, and archive operations.
  • Bacula Console -- application allowing communication with the Director. There are three versions of the Console:
    • Text based command line version.
    • Gnome based gtk+ GUI interface.
    • wxWidgets interface GUI interface.
  • Bacula File -- also known as the Bacula Client program. Installed on machines to be backed up, and is responsible for the data requested by the Director.
  • Bacula Storage -- the programs that perform the storage and recovery of data to the physical media.
  • Bacula Catalog -- responsible for maintaining the file indexes and volume databases for all files backed up. The catalog enables quick location and restoration of archived files. The Catalog supports three different databases MySQL, PostgreSQL, and SQLite.
  • 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

There are multiple packages containing the different Bacula components. Currently the Bacula packages are in the Universe repository, but work is being done to get the core packages into the Main repository. By default installing the bacula package will install the bacula-director-sqlite3 package which will use SQLite for the Catalog. If you want to use MySQL or PostgreSQL for the catalog install bacula-director-mysql or bacula-director-pgsql respectively. NOTE: as of Karmic (Ubuntu 9.10) the default database backend is mysql. See InstallingSoftware for information on repositories and using package managers. After installing Bacula the bacula-sd daemon may have an issue starting because there is no storage device configured. A work around for this error is to configure an Archive Device in the /etc/bacula/bacula-sd.conf file, and enter the following apt command to complete the package install:

sudo apt-get install -f

Bacula also requires a Mail Transfer Agent (MTA). The default Ubuntu MTA is Postfix, but it is possible to use another MTA such as Exim4. For details on setting up Postfix see Postfix

Configuration

Bacula configuration files are formatted based on resources comprising of directives surrounded by "{}" braces. The files are located in the /etc/bacula directory, and there is a file for each component. The various Bacula components must authorize themselves to each other. This is accomplished using the password directive. For example the Storage resource password in the /etc/bacula/bacula-dir.conf file must match the Director resource password in /etc/bacula/bacula-sd.conf. By default Bacula configures a FileSet and job to backup itself. The job name is Client1 by default. 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 /etc/bacula/bacula-dir.conf:

#
# Define the main nightly save backup job
#   By default, this job will back up to disk in 
Job {
Name = "BackupServer"
JobDefs = "DefaultJob"
Write Bootstrap = "/var/lib/bacula/Client1.bsr"
}
  • The example above changes the job name to BackupServer matching the machine's host 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 prompt:

sudo adduser $username bacula
  • Replacing $username with an actual username. Also, if you are adding the current user to the group you will need to 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.

  • First, the Storage device needs to be configured. Edit /etc/bacula/bacula-sd.conf add:
Device {
Name = "Tape Drive"
Device Type = tape
Media Type = DDS-4
Archive Device = /dev/st0
Hardware end of medium = No;
AutomaticMount = yes;               # when device opened, read it
AlwaysOpen = Yes;
RemovableMedia = yes;
RandomAccess = no;
Alert Command = "sh -c 'tapeinfo -f %c | grep TapeAlert'"
}
  • 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.
  • After editing /etc/bacula/bacula-sd.conf the Bacula Storage deamon will need to be restarted:
sudo /etc/init.d/bacula-sd restart
  • Now add a Storage resource in /etc/bacula/bacula-dir.conf to use the new Device:
# Definition of "Tape Drive" storage device
Storage {
Name = TapeDrive
# Do not use "localhost" here    
Address = backupserver               # N.B. Use a fully qualified name here
SDPort = 9103
Password = "Cv70F6pf1t6pBopT4vQOnigDrR0v3LT3Cgkiyj"
Device = "Tape Drive"
Media Type = tape
}
  • The Address directive needs to be the Fully Qualified Domain Name (FQDN) of the server. Change backupserver to the actual host name.
  • Make sure the Password directive matches the password string in /etc/bacula/bacula-sd.conf.
  • Create a new FileSet which will determines what directories to backup, add:
# LocalhostBacup FileSet.
FileSet {
Name = "LocalhostFiles"
Include {
Options {
signature = MD5
compression=GZIP
}
File = /etc
File = /home
}
}
  • This FileSet will backup the /etc and /home directories. The Options resource directives configure the FileSet to create a MD5 signature for each file backed up, and to compress the files using GZIP.
  • Next, create a new Schedule for the backup job:
# LocalhostBackup Schedule -- Daily.
Schedule {
Name = "LocalhostDaily"
Run = Full daily at 00:01
}
  • The job will run every day at 00:01 or 12:01 am. There are many other scheduling options available.
  • Finally create the Job:
# Localhost backup.
Job {
Name = "LocalhostBackup"
JobDefs = "DefaultJob"
Enabled = yes
Level = Full
FileSet = "LocalhostFiles"
Schedule = "LocalhostDaily"
Storage = TapeDrive
Write Bootstrap = "/var/lib/bacula/LocalhostBackup.bsr"
}  
  • The job will do a Full backup every day to the tape drive.
  • 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:
bconsole
  • At the Bacula Console prompt enter:
label
  • You will then be prompted for the Storage resource:
Automatically selected Catalog: MyCatalog
Using Catalog "MyCatalog"
The defined Storage resources are:
1: File
2: TapeDrive
Select Storage resource (1-2): 2
  • Enter the new Volume name:
Enter new Volume name: Sunday
Defined Pools:
1: Default
2: Scratch
  • Select the Pool:
Select the Pool (1-2): 1
Connecting to Storage daemon TapeDrive at backupserver:9103 ...
Sending label command for Volume "Sunday" Slot 0 ...

Notes

By using the apt-get command we are downloading the available build from Ubuntu universe. For karmic you can check the version available at http://packages.ubuntu.com/karmic/admin/ (at time of writting it was version 2.4.4-1ubuntu9 and in source there is up to verison 5)

Resources