Bacula Sicherung auf Band

Alle weiteren Dienste, die nicht in die drei oberen Foren gehören.
Antworten
uwe2034
Beiträge: 2
Registriert: 16.02.2018 21:07:39

Bacula Sicherung auf Band

Beitrag von uwe2034 » 11.11.2018 13:50:51

Hallo, habe einen Debian Server mit stretch/Kernel 4.9.0-8-amd64. Für die Sicherung habe ich Bacula Version: 7.4.4 konfiguriert. Läuft alles prima.
Ich habe nur ein kleines Problem mit der Sicherung auf Band (DAT-160),
wenn ich den definierten Job automatisch ausführen lasse kann er nur eine Sicherung auf das Band schreiben, bei der zweiten Sicherung setzt Bacula das Band auf Status Error.
Wo könnte ich nach der Ursache suchen?

#
# Default Bacula Director Configuration file
#
# The only thing that MUST be changed is to add one or more
# file or directory names in the Include directive of the
# FileSet resource.
#
# For Bacula release 7.4.4 (20 September 2016) -- debian 9.0
#
# You might also want to change the default email address
# from root to your address. See the "mail" and "operator"
# directives in the Messages resource.
#
# Copyright (C) 2000-2015 Kern Sibbald
# License: BSD 2-Clause; see file LICENSE-FOSS
#

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

JobDefs {
Name = "DefaultJob"
Type = Backup
Level = Incremental
Client = HOMESRV-fd
Schedule = "WeeklyCycle"
Storage = HDD1
Messages = Standard
Pool = File
SpoolAttributes = yes
Priority = 10
Write Bootstrap = "/var/lib/bacula/%c.bsr"
}


#
# Define the main nightly save backup job
# By default, this job will back up to disk in /nonexistant/path/to/file/archive/dir
Job {
Name = "Daten"
JobDefs = "DefaultJob"
FileSet = "Daten-HOMESRV"
}

Job {
Name = "Bilder-Video"
JobDefs = "DefaultJob"
FileSet = "Bilder-Video"
Pool = Video_Bilder
Schedule = "Monat"
}


Job {
Name = "Daten-Tape"
JobDefs = "DefaultJob"
FileSet = "Daten-HOMESRV"
Level = Full
Schedule = "Monat2"
Storage = HP-DAT-160
Spool Data = yes # Avoid shoe-shine
Pool = Tape-DAT160
Enabled = no
}


# Backup the catalog database (after the nightly save)
Job {
Name = "BackupCatalog"
JobDefs = "DefaultJob"
Level = Full
FileSet="Catalog"
Schedule = "WeeklyCycleAfterBackup"
# This creates an ASCII copy of the catalog
# Arguments to make_catalog_backup.pl are:
# make_catalog_backup.pl <catalog-name>
RunBeforeJob = "/etc/bacula/scripts/make_catalog_backup.pl MyCatalog"
# This deletes the copy of the catalog
RunAfterJob = "/etc/bacula/scripts/delete_catalog_backup"
Write Bootstrap = "/var/lib/bacula/%n.bsr"
Priority = 11 # run after main backup
}

#
# Standard Restore template, to be changed by Console program
# Only one such job is needed for all Jobs/Clients/Storage ...
#
Job {
Name = "RestoreFiles"
Type = Restore
Client=HOMESRV-fd
FileSet="Full Set"
Storage = HDD1
Pool = File
Messages = Standard
Where = /1Install/.Backup
}

# zu Sichernde Daten - List of files to be backed up
FileSet {
Name = "Daten-HOMESRV"
Include {
Options {
signature = MD5
}

File = /1Daten/Daten
File = /1Daten/Ablage
}

Exclude {
File = /1Daten/Daten/Profiles/Firefox
File = /.journal
File = /.fsck
}
}

FileSet {
Name = "Bilder-Video"
Include {
Options {
signature = MD5
}

File = /1Daten/Bilder
File = /1Daten/Videos
}

Exclude {
File = /.journal
File = /.fsck
}
}

FileSet {
Name = "Test-Tape"
Include {
Options {
signature = MD5
}

File = /1Daten/Ablage/2_Home_Netz

}

Exclude {
File = /.journal
File = /.fsck
}
}

# List of files to be backed up
FileSet {
Name = "Full Set"
Include {
Options {
signature = MD5
}
#
# Put your list of files here, preceded by 'File =', one per line
# or include an external list with:
#
# File = <file-name
#
# Note: / backs up everything on the root partition.
# if you have other partitions such as /usr or /home
# you will probably want to add them too.
#
# By default this is defined to point to the Bacula binary
# directory to give a reasonable FileSet to backup to
# disk storage during initial testing.
#
File = /usr/sbin
}

#
# If you backup the root directory, the following two excluded
# files can be useful
#
Exclude {
File = /var/lib/bacula
File = /nonexistant/path/to/file/archive/dir
File = /proc
File = /tmp
File = /sys
File = /.journal
File = /.fsck
}
}

#
# When to do the backups, full backup on first sunday of the month,
# differential (i.e. incremental since full) every other sunday,
# and incremental backups other days
Schedule {
Name = "WeeklyCycle"
Run = Full 1st mon at 9:05
Run = Differential 2nd-5th mon at 9:05
Run = Incremental tue-sun at 9:05
}

# This schedule does the catalog. It starts after the WeeklyCycle
Schedule {
Name = "WeeklyCycleAfterBackup"
Run = Full sun-sat at 23:10
}

Schedule {
Name = "MonthlyCycle"
Run = 1st tue at 8:00
}


Schedule {
Name = "Woche"
Run = Full weekly mon at 7:00
}

Schedule {
Name = "Monat"
Run = Full monthly 1st tue at 2:00
Run = Differential 2nd-5th tue at 2:00
}

#Tape-Backup
Schedule {
Name = "Monat2"
Run = Full monthly 1st thu at 2:00
}

Schedule {
Name = "Test"
Run = Full daily at 20:00
Run = Differential 2nd-5th tue at 2:00
}

Schedule {
Name = "aller15Min"
Run = Level=Full hourly at 0:00
Run = Level=Full hourly at 0:15
Run = Level=Full hourly at 0:30
Run = Level=Full hourly at 0:45

}

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

# Client (File Services) to backup
Client {
Name = HOMESRV-fd
Address = 127.0.0.1
FDPort = 9102
Catalog = MyCatalog
Password = "0815" # password for FileDaemon
File Retention = 60 days # 60 days
Job Retention = 6 months # six months
AutoPrune = yes # Prune expired Jobs/Files
}

#
# Second Client (File Services) to backup
# You should change Name, Address, and Password before using
#
#Client {
# Name = HOMESRV2-fd
# Address = localhost2
# FDPort = 9102
# Catalog = MyCatalog
# Password = "0815" # password for FileDaemon 2
# File Retention = 60 days # 60 days
# Job Retention = 6 months # six months
# AutoPrune = yes # Prune expired Jobs/Files
#}


# Definition of file Virtual Autochanger device
Storage {
Name = HDD1
# Do not use "localhost" here
Address = 127.0.0.1 # N.B. Use a fully qualified name here
SDPort = 9103
Password = "0815"
Device = HDDBackup
Media Type = File
Maximum Concurrent Jobs = 10 # run up to 10 jobs a the same time
}

Storage {
Name = HP-DAT-160
# Do not use "localhost" here
Address = 127.0.0.1 # N.B. Use a fully qualified name here
SDPort = 9103
Password = "0815"
Device = DAT-160
Media Type = DDS6
Maximum Concurrent Jobs = 1 # run up to 10 jobs a the same time
AllowCompression = yes
}



# Generic catalog service
Catalog {
Name = MyCatalog
dbname = "bacula"; dbuser = ""; dbpassword = ""
}

# 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
}


#
# Message delivery for daemon messages (no job).
Messages {
Name = Daemon
mailcommand = "/usr/sbin/bsmtp -h localhost -f \"\(Bacula\) \<%r\>\" -s \"Bacula daemon message\" %r"
mail = root = all, !skipped
console = all, !skipped, !saved
append = "/var/log/bacula/bacula.log" = all, !skipped
}

# Default pool definition
Pool {
Name = Default
Pool Type = Backup
Recycle = yes # Bacula can automatically recycle Volumes
AutoPrune = yes # Prune expired volumes
Volume Retention = 365 days # one year
Maximum Volume Bytes = 50G # Limit Volume size to something reasonable
Maximum Volumes = 100 # Limit number of Volumes in Pool
}

# File Pool definition
Pool {
Name = File
Pool Type = Backup
Recycle = yes # Bacula can automatically recycle Volumes
AutoPrune = yes # Prune expired volumes
Volume Retention = 365 days # one year
Maximum Volume Bytes = 50G # Limit Volume size to something reasonable
Maximum Volumes = 100 # Limit number of Volumes in Pool
Label Format = "Vol-" # Auto label
}

Pool {
Name = Video_Bilder
Pool Type = Backup
Recycle = yes # Bacula can automatically recycle Volumes
AutoPrune = yes # Prune expired volumes
Volume Retention = 365 days # one year
Maximum Volume Bytes = 50G # Limit Volume size to something reasonable
Maximum Volumes = 100 # Limit number of Volumes in Pool
Label Format = "HDDVol-" # Auto label
}

# File Pool definition
Pool {
Name = Tape-DAT160
Pool Type = Backup
#Recycle = yes # Bacula can automatically recycle Volumes
#AutoPrune = yes # Prune expired volumes
#Volume Retention = 365 days # one year
Maximum Volume Bytes = 160G # Limit Volume size to something reasonable
Maximum Volumes = 100 # Limit number of Volumes in Pool
Label Format = "Band-" # Auto label
}

# File Pool definition
#Pool {
# Name = Tape-72GB
# Pool Type = Backup
# Recycle = yes # Bacula can automatically recycle Volumes
# AutoPrune = yes # Prune expired volumes
# Volume Retention = 365 days # one year
# Maximum Volume Bytes = 72G # Limit Volume size to something reasonable
# Maximum Volumes = 100 # Limit number of Volumes in Pool
# Label Format = "Band-" # Auto label
#}

# Scratch pool definition
Pool {
Name = Scratch
Pool Type = Backup
}

#
# Restricted console used by tray-monitor to get the status of the director
#
Console {
Name = HOMESRV-mon
Password = "0815"
CommandACL = status, .status
}

Benutzeravatar
Six
Beiträge: 8066
Registriert: 21.12.2001 13:39:28
Lizenz eigener Beiträge: MIT Lizenz
Wohnort: Siegburg

Re: Bacula Sicherung auf Band

Beitrag von Six » 15.11.2018 12:15:21

Hi Uwe,

wir brauchen vermutlich die Storage Daemon Konfiguration. Poste mal die bacula-sd.conf und was sagt denn

Code: Alles auswählen

btape test <device>
http://www.bacula.org/5.1.x-manuals/en/ ... Drive.html

Beste Grüße
Be seeing you!

uwe2034
Beiträge: 2
Registriert: 16.02.2018 21:07:39

Re: Bacula Sicherung auf Band

Beitrag von uwe2034 » 19.11.2018 22:07:12

Hallo, sorry für die Verspätung.
Wie gewünscht die erforderlichen Angaben.

#
# Default Bacula Storage Daemon Configuration file
#
# For Bacula release 7.4.4 (20 September 2016) -- debian 9.0
#
# 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.
#
#
# Copyright (C) 2000-2015 Kern Sibbald
# License: BSD 2-Clause; see file LICENSE-FOSS
#

Storage { # definition of myself
Name = HOMESRV-sd
SDPort = 9103 # Director's port
WorkingDirectory = "/var/lib/bacula"
Pid Directory = "/run/bacula"
Maximum Concurrent Jobs = 20
SDAddress = 127.0.0.1
}

#
# List Directors who are permitted to contact Storage daemon
#
Director {
Name = HOMESRV-dir
Password = "0815"
}

#
# Restricted Director, used by tray-monitor to get the
# status of the storage daemon
#
Director {
Name = HOMESRV-mon
Password = "0815"
Monitor = yes
}

#
# Note, for a list of additional Device templates please
# see the directory <bacula-source>/examples/devices
# Or follow the following link:
# http://bacula.svn.sourceforge.net/viewv ... s/devices/
#

#
# Devices supported by this Storage daemon
# To connect, the Director's bacula-dir.conf must have the
# same Name and MediaType.
#

Device {
Name = HDDBackup
Media Type = File
Archive Device = /Backup/Pool
LabelMedia = yes; # lets Bacula label unlabeled media
Random Access = Yes;
AutomaticMount = yes; # when device opened, read it
RemovableMedia = no;
AlwaysOpen = no;
Maximum Concurrent Jobs = 5
}


Device {
Name = DAT-160
Description = "HP DAT-160"
Media Type = DDS6
Archive Device = /dev/st0
AutomaticMount = yes; # when device opened, read it
RemovableMedia = yes;
AlwaysOpen = yes
Offline On Unmount = no
Hardware End of Medium = yes
BSF at EOM = yes
Backward Space Record = no
Fast Forward Space File = no
TWO EOF = yes
}

#
# Send all messages to the Director,
# mount messages also are sent to the email address
#
Messages {
Name = Standard
director = HOMESRV-dir = all
}

---------------------------

sudo btape -c /etc/bacula/bacula-sd.conf /dev/st0
Tape block granularity is 1024 bytes.
btape: butil.c:291-0 Using device: "/dev/st0" for writing.
btape: btape.c:471-0 open device "DAT-160" (/dev/st0): OK
*test

=== Write, rewind, and re-read test ===

I'm going to write 10000 records and an EOF
then write 10000 records and an EOF, then rewind,
and re-read the data to verify that it is correct.

This is an *essential* feature ...

btape: btape.c:1154-0 Wrote 10000 blocks of 64412 bytes.
btape: btape.c:606-0 Wrote 1 EOF to "DAT-160" (/dev/st0)
btape: btape.c:1170-0 Wrote 10000 blocks of 64412 bytes.
btape: btape.c:606-0 Wrote 1 EOF to "DAT-160" (/dev/st0)
btape: btape.c:606-0 Wrote 1 EOF to "DAT-160" (/dev/st0)
btape: btape.c:1212-0 Rewind OK.
10000 blocks re-read correctly.
Got EOF on tape.
10000 blocks re-read correctly.
=== Test Succeeded. End Write, rewind, and re-read test ===

btape: btape.c:1279-0 Block position test
btape: btape.c:1291-0 Rewind OK.
Reposition to file:block 0:4
Block 5 re-read correctly.
Reposition to file:block 0:200
Block 201 re-read correctly.
Reposition to file:block 0:9999
Block 10000 re-read correctly.
Reposition to file:block 1:0
Block 10001 re-read correctly.
Reposition to file:block 1:600
Block 10601 re-read correctly.
Reposition to file:block 1:9999
Block 20000 re-read correctly.
=== Test Succeeded. End Write, rewind, and re-read test ===



=== Append files test ===

This test is essential to Bacula.

I'm going to write one record in file 0,
two records in file 1,
and three records in file 2

btape: btape.c:576-0 Rewound "DAT-160" (/dev/st0)
btape: btape.c:1909-0 Wrote one record of 64412 bytes.
btape: btape.c:1911-0 Wrote block to device.
btape: btape.c:606-0 Wrote 1 EOF to "DAT-160" (/dev/st0)
btape: btape.c:1909-0 Wrote one record of 64412 bytes.
btape: btape.c:1911-0 Wrote block to device.
btape: btape.c:1909-0 Wrote one record of 64412 bytes.
btape: btape.c:1911-0 Wrote block to device.
btape: btape.c:606-0 Wrote 1 EOF to "DAT-160" (/dev/st0)
btape: btape.c:1909-0 Wrote one record of 64412 bytes.
btape: btape.c:1911-0 Wrote block to device.
btape: btape.c:1909-0 Wrote one record of 64412 bytes.
btape: btape.c:1911-0 Wrote block to device.
btape: btape.c:1909-0 Wrote one record of 64412 bytes.
btape: btape.c:1911-0 Wrote block to device.
btape: btape.c:606-0 Wrote 1 EOF to "DAT-160" (/dev/st0)
btape: btape.c:606-0 Wrote 1 EOF to "DAT-160" (/dev/st0)
btape: btape.c:471-0 open device "DAT-160" (/dev/st0): OK
btape: btape.c:576-0 Rewound "DAT-160" (/dev/st0)
btape: btape.c:1422-0 Now moving to end of medium.
btape: btape.c:627-0 Moved to end of medium.
We should be in file 3. I am at file 3. This is correct!

Now the important part, I am going to attempt to append to the tape.

btape: btape.c:1909-0 Wrote one record of 64412 bytes.
btape: btape.c:1911-0 Wrote block to device.
btape: btape.c:606-0 Wrote 1 EOF to "DAT-160" (/dev/st0)
btape: btape.c:606-0 Wrote 1 EOF to "DAT-160" (/dev/st0)
btape: btape.c:576-0 Rewound "DAT-160" (/dev/st0)
Done appending, there should be no I/O errors

Doing Bacula scan of blocks:
1 block of 64448 bytes in file 1
End of File mark.
2 blocks of 64448 bytes in file 2
End of File mark.
3 blocks of 64448 bytes in file 3
End of File mark.
1 block of 64448 bytes in file 4
End of File mark.
Total files=4, blocks=7, bytes = 451,136
End scanning the tape.
We should be in file 4. I am at file 4. This is correct!

The above Bacula scan should have output identical to what follows.
Please double check it ...
=== Sample correct output ===
1 block of 64448 bytes in file 1
End of File mark.
2 blocks of 64448 bytes in file 2
End of File mark.
3 blocks of 64448 bytes in file 3
End of File mark.
1 block of 64448 bytes in file 4
End of File mark.
Total files=4, blocks=7, bytes = 451,136
=== End sample correct output ===

If the above scan output is not identical to the
sample output, you MUST correct the problem
or Bacula will not be able to write multiple Jobs to
the tape.

Skipping read backwards test because BSR turned off.


=== Forward space files test ===

This test is essential to Bacula.

I'm going to write five files then test forward spacing

btape: btape.c:576-0 Rewound "DAT-160" (/dev/st0)
btape: btape.c:1909-0 Wrote one record of 64412 bytes.
btape: btape.c:1911-0 Wrote block to device.
btape: btape.c:606-0 Wrote 1 EOF to "DAT-160" (/dev/st0)
btape: btape.c:1909-0 Wrote one record of 64412 bytes.
btape: btape.c:1911-0 Wrote block to device.
btape: btape.c:1909-0 Wrote one record of 64412 bytes.
btape: btape.c:1911-0 Wrote block to device.
btape: btape.c:606-0 Wrote 1 EOF to "DAT-160" (/dev/st0)
btape: btape.c:1909-0 Wrote one record of 64412 bytes.
btape: btape.c:1911-0 Wrote block to device.
btape: btape.c:1909-0 Wrote one record of 64412 bytes.
btape: btape.c:1911-0 Wrote block to device.
btape: btape.c:1909-0 Wrote one record of 64412 bytes.
btape: btape.c:1911-0 Wrote block to device.
btape: btape.c:606-0 Wrote 1 EOF to "DAT-160" (/dev/st0)
btape: btape.c:1909-0 Wrote one record of 64412 bytes.
btape: btape.c:1911-0 Wrote block to device.
btape: btape.c:1909-0 Wrote one record of 64412 bytes.
btape: btape.c:1911-0 Wrote block to device.
btape: btape.c:606-0 Wrote 1 EOF to "DAT-160" (/dev/st0)
btape: btape.c:1909-0 Wrote one record of 64412 bytes.
btape: btape.c:1911-0 Wrote block to device.
btape: btape.c:606-0 Wrote 1 EOF to "DAT-160" (/dev/st0)
btape: btape.c:606-0 Wrote 1 EOF to "DAT-160" (/dev/st0)
btape: btape.c:576-0 Rewound "DAT-160" (/dev/st0)
btape: btape.c:1636-0 Now forward spacing 1 file.
We should be in file 1. I am at file 1. This is correct!
btape: btape.c:1648-0 Now forward spacing 2 files.
We should be in file 3. I am at file 3. This is correct!
btape: btape.c:576-0 Rewound "DAT-160" (/dev/st0)
btape: btape.c:1661-0 Now forward spacing 4 files.
We should be in file 4. I am at file 4. This is correct!

btape: btape.c:1679-0 Now forward spacing 1 more file.
We should be in file 5. I am at file 5. This is correct!

=== End Forward space files test ===

*
ich hoffe das ist so ok.
Gruss Uwe

Antworten