Professional Documents
Culture Documents
backup BACULA
Igor Muzetti Pereira
igormuzetti@gmail.com
Tiago Garcia de Senna Carneiro
tiago@iceb.ufop.br
Departamento de Computao
Universidade Federal de Ouro Preto
___________________________________________________________
Instalao e Configurao do servidor de backup BACULA
1. Introduo
O objetivo deste tutorial mostrar como instalar e configurar o Bacula
que um conjunto de programas que permite ao administrador de sistemas
administrar backup, restaurao e verificao dos dados de computadores em
uma rede de sistemas mistos.
1.2.3. File Daemon: Este servio (ou programa cliente) o software que
instalado na mquina que vai ser protegida pelo backup, ou seja, ele vai ser
responsvel por enviar os arquivos solicitados pelo Director Daemon pela rede.
Ele tambm responsavel em administrar a gravao dos arquivos de
restaurao comandados pelo Director Daemon.
APNDICE A
Arquivo bconsole.conf:
#
# Bacula User Agent (or Console) Configuration File
#
Director {
Name = espinhaco-dir
DIRport = 9101
address = espinhaco
Password = "terralab"
}
APNDICE B
Arquivo bacula-fd.conf:
#
#
#
#
#
#
#
#
Default Bacula File Daemon Configuration file
For Bacula release 5.0.3 (04 August 2010) -- debian 5.0.5
There is not much to change here except perhaps the
File daemon Name to
#
# List Directors who are permitted to contact this File daemon
#
Director {
Name = espinhaco-dir
Password = "terralab"
}
#
# Restricted Director, used by tray-monitor to get the
# status of the file daemon
#
Director {
Name = espinhaco-mon
Password = "terralab"
Monitor = yes
}
#
# "Global" File daemon configuration specifications
#
FileDaemon {
# this is me
Name = espinhaco-fd
FDport = 9102
# where we listen for the director
WorkingDirectory = /var/bacula/working
Pid Directory = /var/run
Maximum Concurrent Jobs = 20
}
# Send all messages except skipped files back to Director
Messages {
Name = Standard
director = espinhaco-dir = all, !skipped, !restored
}
APNDICE C
Arquivo bacula-sd.conf:
#
# Default Bacula Storage Daemon Configuration file
#
# For Bacula release 5.0.3 (04 August 2010) -- debian 5.0.5
#
# You may need to change the name of your tape drive
# on the "Archive Device" directive in the Device
# resource. If you change the Name and/or the
# "Media Type" in the Device resource, please ensure
# that dird.conf has corresponding changes.
#
Storage {
# definition of myself
Name = espinhaco-sd
SDPort = 9103
# Director's port
WorkingDirectory = "/var/bacula/working"
Pid Directory = "/var/run"
Maximum Concurrent Jobs = 20
}
#
# List Directors who are permitted to contact Storage daemon
#
Director {
Name = espinhaco-dir
Password = "terralab"
}
#
# Restricted Director, used by tray-monitor to get the
# status of the storage daemon
#
Director {
Name = espinhaco-mon
Password = "terralab"
Monitor = yes
}
#
# Devices supported by this Storage daemon
# To connect, the Director's bacula-dir.conf must have the
# same Name and MediaType.
#
Device {
Name = File
Media Type = File
Archive Device = /media/backup/
LabelMedia = yes;
# lets Bacula label unlabeled media
Random Access = Yes;
AutomaticMount = yes;
# when device opened, read it
RemovableMedia = no;
AlwaysOpen = no;
}
# Send all messages to the Director,
# mount messages also are sent to the email address
#
Messages {
Name = Standard
director = espinhaco-dir = all
}
APNDICE D
Arquivo bacula-dir.conf:
#
#
#
#
#
#
#
#
#
#
#
#
#
Director {
# define myself
Name = espinhaco-dir
DIRport = 9101
# where we listen for UA connections
QueryFile = "/etc/bacula/query.sql"
WorkingDirectory = "/var/bacula/working"
PidDirectory = "/var/run"
Maximum Concurrent Jobs = 5
Password = "terralab"
# Console password
Messages = Daemon
}
Job {
Name = "espinhacoSemanalIncremental"
Enabled = Yes
Level = Incremental
Type = Backup
Client = espinhaco-fd
FileSet= "espinhaco"
Storage = File
Schedule = "espinhacoIncremental"
Pool = Semanal
# Incremental Backup Pool = Semanal
Messages = Daemon
# RunBeforeJob = "usr/sbin/monta_tape.sh"
Priority = 10
}
Job {
Name = "espinhacoFull"
Enabled = Yes
Level = Full
Type = Backup
Client = espinhaco-fd
FileSet= "espinhaco"
Storage = File
Schedule = "espinhacoFull"
Pool = Mensal
# Incremental Backup Pool = Semanal
Messages = Daemon
# RunBeforeJob = "usr/sbin/monta_tape.sh"
Priority = 10
}
# Backup the catalog database (after the nightly save)
Job {
Name = "BackupCatalog"
# JobDefs = "DefaultJob"
Level = Full
Type = Backup
Messages = Daemon
Pool = Mensal
Client = espinhaco-fd
Storage = File
FileSet="Catalog"
Schedule = "espinhacoFull"
Name = File
# Do not use "localhost" here
Address = 192.168.0.204
# N.B. Use a fully qualified name here
SDPort = 9103
Password = "terralab"
Device = File
Media Type = File
}
# Generic catalog service
#ATENCAO use o nome de usuario e senha corretos do mysql(dbuser e dbpassword)
Catalog {
Name = MyCatalog
# Uncomment the following line if you want the dbi driver
# dbdriver = "dbi:mysql"; dbaddress = 127.0.0.1; dbport =
dbname = "bacula"; dbuser = "bacula"; dbpassword = ""
}
# Reasonable message delivery -- send most everything to email address
# and to the console
Messages {
Name = Standard
#
mailcommand = "/sbin/bsmtp -h localhost -f \"\(Bacula\) \<%r\>\" -s \"Bacula: %t %e of %c %l\" %r"
operatorcommand = "/sbin/bsmtp -h localhost -f \"\(Bacula\) \<%r\>\" -s \"Bacula: Intervention needed for %j\"
%r"
mail = root@localhost = all, !skipped
operator = root@localhost = mount
console = all, !skipped, !saved
#
# WARNING! the following will create a file that you must cycle from
#
time to time as it will grow indefinitely. However, it will
#
also keep all your messages if they scroll off the console.
#
append = "/var/bacula/working/log" = all, !skipped
catalog = all
}
#
# Message delivery for daemon messages (no job).
Messages {
Name = Daemon
mailcommand = "/sbin/bsmtp -h localhost -f \"\(Bacula\) \<%r\>\" -s \"Bacula daemon message\" %r"
mail = root@localhost = all, !skipped
console = all, !skipped, !saved
append = "/var/bacula/working/log" = all, !skipped
}
# Default pool definition
Pool {
Name = Semanal
Pool Type = Backup
Recycle = yes
AutoPrune = yes
Volume Retention = 7 days
}