Error: 1043 - Ao realizar backup do catalogo.

1. Error: 1043 - Ao realizar backup do catalogo.

keytson
keytson

(usa Debian)

Enviado em 19/04/2015 - 11:21h


Olá a todos.

Legal essa comunidade. Parabéns pela iniciativa.

Vamos lá, meu cenário

"Configuração bacula-dir.con"

Director { # define myself
Name = srvbackup-dir
DIRport = 9101 # where we listen for UA connections
QueryFile = "/etc/bacula/scripts/query.sql"
WorkingDirectory = "/var/lib/bacula"
PidDirectory = "/var/run/bacula"
Maximum Concurrent Jobs = 1
Password = "I4SwM8_Y_H8h9oMshKNBLovRkf0x92TJH" # Console password
Messages = Daemon
# DirAddress = 127.0.0.1
}

# Definições Jobs e Clientes
@/etc/bacula/bacula-dir-clients-and-jobs.conf


# Definições de Arquivos (FileSet)
@/etc/bacula/bacula-dir-fileset.conf


# Agendamento do backup dos Arquivos (Todos)
Schedule {
Name = "WeeklyCycle"
Run = Full 1st sun at 23:05
Run = Differential 2nd-5th sun at 23:05
Run = Incremental mon-sat at 23:05
}

# Agendamento do Catalogos
Schedule {
Name = "WeeklyCycleAfterBackup"
Run = Full sun-sat at 23:10
}

# Definição do Dispositivo de Armazenamento
Storage {
Name = File
# Do not use "localhost" here
Address = x.x.x.x # N.B. Use a fully qualified name here
SDPort = 9103
Password = "@@@@@@@@@@@@@@"
Device = FileStorage
Media Type = File
}

# Generic catalog service
Catalog {
Name = MyCatalog
# Uncomment the following line if you want the dbi driver
# dbdriver = "dbi:postgresql"; dbaddress = 127.0.0.1; dbport =
dbname = "bacula"; DB Address = ""; dbuser = "bacula"; dbpassword = "xxxxx#"
}

# Reasonable message delivery -- send most everything to email address
# and to the console
Messages {
Name = Standard
#
# NOTE! If you send to two email or more email addresses, you will need
# to replace the %r in the from field (-f part) with a single valid
# email address in both the mailcommand and the operatorcommand.
# What this does is, it sets the email address that emails would display
# in the FROM field, which is by default the same email as they're being
# sent to. However, if you send email to more than one address, then
# you'll have to set the FROM address manually, to a single address.
# for example, a 'no-reply@mydomain.com', is better since that tends to
# tell (most) people that its coming from an automated source.

#
mailcommand = "/usr/sbin/bsmtp -h localhost -f \"\(Bacula\) \<%r\>\" -s \"Bacula: %t %e of %c %l\" %r"
operatorcommand = "/usr/sbin/bsmtp -h localhost -f \"\(Bacula\) \<%r\>\" -s \"Bacula: Intervention needed for %j\" %r"
mail = root = all, !skipped
operator = root = 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/log/bacula/bacula.log" = all, !skipped
catalog = all
}


diretório /etc/bacula/bacula-dir-clients-and-jobs.conf

# Jobs e Clientes do Diretor
#
#

JobDefs {
Name = "DefaultJob"
Type = Backup
Level = Incremental
Client = srvbackup-fd
FileSet = "Full Set"
Schedule = "WeeklyCycle"
Storage = File
Messages = Standard
Pool = File
Priority = 10
Write Bootstrap = "/var/lib/bacula/%c.bsr"
Allow Duplicate Jobs = no # Não cria backups duplicados
}

# Sempre colocar Job e Clientes Juntos (Backup do Director)

Job {
Name = "BackupDirector"
JobDefs = "DefaultJob"
Client = srvbackup-fd
}

Client {
Name = srvbackup-fd
Address = localhost
FDPort = 9102
Catalog = MyCatalog
Password = "@@@@@@@@@@@@@@@@@@" # password for FileDaemon
File Retention = 30 days # 30 days
Job Retention = 6 months # six months
AutoPrune = yes # Prune expired Jobs/Files
}

# Backup Servidor AD/Arquivos
Job {
Name = "BackupServidorAD"
JobDefs = "DefaultJob"
FileSet = "ServidorAD"
Client = srvad-fd
}

Client {
Name = srvad-fd
Address = srvad.grupomap.local
FDPort = 9102
Catalog = MyCatalog
Password = "@@@@@@@@@@@@@@@@" # password for FileDaemon
File Retention = 30 days # 30 days
Job Retention = 6 months # six months
AutoPrune = yes # Prune expired Jobs/Files
}

# Backup host(hostname)


Job {
Name = "hostname"
JobDefs = "DefaultJob"
FileSet = "BackupUsers"
Client = client-fd
}

Client {
Name = hostname
Address = x.x.x.x
FDPort = 9102
Catalog = MyCatalog
Password = "@@@@@@@@@@@@@@@@@" # password for FileDaemon
File Retention = 30 days # 30 days
Job Retention = 6 months # six months
AutoPrune = yes # Prune expired Jobs/Files
}

# Backup do bando de dados mysql
Job {
Name = "BackupCatalog"
JobDefs = "DefaultJob"
Level = Full
FileSet="Catalog"
Schedule = "WeeklyCycleAfterBackup"
RunBeforeJob = "/etc/bacula/scripts/make_catalog_backup.pl MyCatalog"
RunAfterJob = "/etc/bacula/scripts/delete_catalog_backup"
Write Bootstrap = "/var/lib/bacula/%n.bsr"
Priority = 11 # run after main backup
}

# Job para Restore
Job {
Name = "RestoreFiles"
Type = Restore
Client=srvbackup-fd
FileSet="Full Set"
Storage = File
Pool = File
Messages = Standard
Where = /restore/Restore
}

Diretório /etc/bacula/bacula-dir-fileset.conf

FileSet {
Name = "Full Set"
Include {
Options {
signature = MD5
}
File = /usr/sbin
File = /home
}
Exclude {
File = /var/lib/bacula
File = /nonexistant/path/to/file/archive/dir
File = /proc
File = /tmp
File = /.journal
File = /.fsck
}
}

# Backup Servidor AD/Arquivos
FileSet {
Name = "ServidorAD"
Include {
Options {
signature = MD5
}
File = /usr/local/samba
File = /home/Suporte
File = /home/Arquivos
}
}

# Babackup Computador T.I
FileSet {
Name = BackupUsers
Include {
Options {
signature = MD5
}
File = "C:/Users/client"
}
}

# This is the backup of the catalog
FileSet {
Name = "Catalog"
Include {
Options {
signature = MD5
}
File = "/var/lib/bacula/bacula.sql"
}
}


Print do Erro:
19-Abr 09:55 srvbackup-dir JobId 33: shell command: run BeforeJob "/etc/bacula/scripts/make_catalog_backup.pl MyCatalog"
19-Abr 09:55 srvbackup-dir JobId 33: BeforeJob: mysqldump: Got error: 1045: Access denied for user 'bacula'@'localhost' (using password: YES) when trying to connect
19-Abr 09:55 srvbackup-dir JobId 33: Error: Runscript: BeforeJob returned non-zero status=2. ERR=Child exited with code 2
19-Abr 09:55 srvbackup-dir JobId 33: Error: Bacula srvbackup-dir 5.2.6 (21Feb12):
Build OS: x86_64-pc-linux-gnu debian 7.0
JobId: 33
Job: BackupCatalog.2015-04-19_09.55.29_03
Backup Level: Full
Client: "srvbackup-fd" 5.2.6 (21Feb12) x86_64-pc-linux-gnu,debian,7.0
FileSet: "Catalog" 2015-04-18 23:10:00
Pool: "File" (From Job resource)
Catalog: "MyCatalog" (From Client resource)
Storage: "File" (From Job resource)
Scheduled time: 19-Abr-2015 09:55:26
Start time: 19-Abr-2015 09:55:31
End time: 19-Abr-2015 09:55:31
Elapsed time: 0 secs
Priority: 11
FD Files Written: 0
SD Files Written: 0
FD Bytes Written: 0 (0 B)
SD Bytes Written: 0 (0 B)
Rate: 0.0 KB/s
Software Compression: None
VSS: no
Encryption: no
Accurate: no
Volume name(s):
Volume Session Id: 0
Volume Session Time: 0
Last Volume Bytes: 0 (0 B)
Non-fatal FD errors: 1
SD Errors: 0
FD termination status:
SD termination status:
Termination: *** Backup Error ***

Esse é meu cenário:

Já tentei as seguintes soluções:
https://groups.google.com/forum/#!topic/bacula-backup-pt-br/EHBSW6RQL_o

Obs.: Consigo logar com o usuário bacula via console usando o comando: mysql -u bacula -p (Enter)
Depois coloca a senha e loga normal. Porém quando vai rodar o script acima para esse erro dito.

Se alguém da comunidade já passou por isso ou sabe de alguma medida de correção, agradeço a ajuda. Espero ter sido claro.

Grato.

Keytson Barroso - Compartilhando Conhecimento.




  


2. Correção do erro ao tentar fazer backup do "catalogo" no "Bacula"

Jonathan Emanoel de Freitas Moura
jefm

(usa Debian)

Enviado em 31/07/2015 - 17:24h

Olá,
Boa tarde Keytson Barroso, tudo bem?
Eu tive o mesmo problema e após várias pesquisas conseguir identificar o problema, em meu caso, as permissões dos arquivos do bacula deveriam ser alteradas, tive que forçar as permissões, abaixo irei relata os comandos que usei para corrigir o problema:

Comandos (Execute os comandos):
1º chmod 755 /etc/bacula/
2º chgrp bacula /etc/bacula/ -R
3º chown root:bacula /etc/bacula/scripts/ -R
4º chmod 755 /etc/bacula/scripts/ -R


Mensagem antes de corrigir as permissões:

31-Jul 16:51 bacula-dir JobId 18: shell command: run BeforeJob "/etc/bacula/scripts/make_catalog_backup.pl MyCatalog"
31-Jul 16:51 bacula-dir JobId 18: BeforeJob: Can't find your catalog (MyCatalog) in director configuration
31-Jul 16:51 bacula-dir JobId 18: Error: Runscript: BeforeJob returned non-zero status=1. ERR=Child exited with code 1
31-Jul 16:51 bacula-dir JobId 18: Error: Bacula bacula-dir 5.2.6 (21Feb12):
Build OS: i486-pc-linux-gnu debian 7.0
JobId: 18
Job: BackupCatalog.2015-07-31_16.51.49_07
Backup Level: Full
Client: "bacula-fd" 5.2.6 (21Feb12) i486-pc-linux-gnu,debian,7.0
FileSet: "Catalog" 2015-07-27 23:10:00
Pool: "File" (From Job resource)
Catalog: "MyCatalog" (From Client resource)
Storage: "bacula-sd" (From Job resource)
Scheduled time: 31-Jul-2015 16:51:46
Start time: 31-Jul-2015 16:51:51
End time: 31-Jul-2015 16:51:51
Elapsed time: 0 secs
Priority: 11
FD Files Written: 0
SD Files Written: 0
FD Bytes Written: 0 (0 B)
SD Bytes Written: 0 (0 B)
Rate: 0.0 KB/s
Software Compression: None
VSS: no
Encryption: no
Accurate: no
Volume name(s):
Volume Session Id: 0
Volume Session Time: 0
Last Volume Bytes: 0 (0 B)
Non-fatal FD errors: 1
SD Errors: 0
FD termination status:
SD termination status:
Termination: *** Backup Error ***


Mensagem depois de corrigir as permissões:

31-Jul 16:53 bacula-dir JobId 19: shell command: run BeforeJob "/etc/bacula/scripts/make_catalog_backup.pl MyCatalog"
31-Jul 16:53 bacula-dir JobId 19: Start Backup JobId 19, Job=BackupCatalog.2015-07-31_16.53.01_03
31-Jul 16:53 bacula-dir JobId 19: Using Device "FileStorage"
31-Jul 16:53 bacula-sd JobId 19: Volume "volume001" previously written, moving to end of data.
31-Jul 16:53 bacula-sd JobId 19: Ready to append to end of Volume "volume001" size=21936534
31-Jul 16:53 bacula-sd JobId 19: Job write elapsed time = 00:00:01, Transfer rate = 98.57 K Bytes/second
31-Jul 16:53 bacula-dir JobId 19: Bacula bacula-dir 5.2.6 (21Feb12):
Build OS: i486-pc-linux-gnu debian 7.0
JobId: 19
Job: BackupCatalog.2015-07-31_16.53.01_03
Backup Level: Full
Client: "bacula-fd" 5.2.6 (21Feb12) i486-pc-linux-gnu,debian,7.0
FileSet: "Catalog" 2015-07-27 23:10:00
Pool: "File" (From Job resource)
Catalog: "MyCatalog" (From Client resource)
Storage: "bacula-sd" (From Job resource)
Scheduled time: 31-Jul-2015 16:52:59
Start time: 31-Jul-2015 16:53:03
End time: 31-Jul-2015 16:53:04
Elapsed time: 1 sec
Priority: 11
FD Files Written: 1
SD Files Written: 1
FD Bytes Written: 98,463 (98.46 KB)
SD Bytes Written: 98,574 (98.57 KB)
Rate: 98.5 KB/s
Software Compression: None
VSS: no
Encryption: no
Accurate: no
Volume name(s): volume001
Volume Session Id: 3
Volume Session Time: 1438150038
Last Volume Bytes: 22,035,590 (22.03 MB)
Non-fatal FD errors: 0
SD Errors: 0
FD termination status: OK
SD termination status: OK
Termination: Backup OK

31-Jul 16:53 bacula-dir JobId 19: Begin pruning Jobs older than 3 months .
31-Jul 16:53 bacula-dir JobId 19: No Jobs found to prune.
31-Jul 16:53 bacula-dir JobId 19: Begin pruning Files.
31-Jul 16:53 bacula-dir JobId 19: No Files found to prune.
31-Jul 16:53 bacula-dir JobId 19: End auto prune.








Patrocínio

Site hospedado pelo provedor RedeHost.
Linux banner

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts