PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Bacula und Autochanger mit Ubuntu



andy135
01.11.13, 09:32
Hallo zusammen,

ich mache seit geraumer Zeit meinr Backups mit Bacula auf einem Ubuntu Server installiert und einem Autchanger von Tandberg. Funktioniert auch problemlos. Was mich noch stört ist, dass wenn er mit dem Backup fertig ist, das Band im Laufwerk bleibt und nicht in seinen Ursprungsslot zurückbefördert wird. Welche Direktive in Bacula muß ich da ändern ??? Ich habe mal AlwaysOpen auf no gestellt. Scheint aber nicht das Problem zu sein.......

andy135
01.11.13, 18:45
Weiß mir niemand einen guten Rat ?

pibi
01.11.13, 20:47
Nein, leider nicht. Ich denke, die wenigsten Leser hier machen ueberhaupt ein Backup. Und wenn, dann so wie ich mit bacula (oder rsync oder was weiss ich) auf ein NAS. Einfacher, schneller, billiger. Mein altes 4fach-DLT gammelt hier vor sich hin....

Gruss Pit.

andy135
01.11.13, 22:10
Hallo,

ich habe inzwischen eine Notlösung gefunden, wie ich mein Vorhaben realisieren kann. Es funzt, aber ob es optimal ist, weiß ich nicht.
Weißt Du, oder jemand anders hier, wie es mit der Hardwarekomprimierung der Autochanger funktioniert ? Reicht da die Angabe unter Media Type = LTO2 oder muß ich die Hardwarekomprimierung am Autochanger direkt einschalten können ?

pibi
02.11.13, 14:01
Weißt Du, oder jemand anders hier, wie es mit der Hardwarekomprimierung der Autochanger funktioniert ? Reicht da die Angabe unter Media Type = LTO2 oder muß ich die Hardwarekomprimierung am Autochanger direkt einschalten können ?Ich hatte es seinerzeit direkt am DLT eingestellt. Den Befehl dazu weiss ich nicht mehr auswendig, ist zu lange her;-)

Gruss Pit.

Sven_R
03.11.13, 02:27
Die Hardware Kompression auf der Konsole aktivieren:


mt-f / dev/nst0 WEOF
mt-f / dev/nst0 compression 1


Du musst aber bei solchen Konstrukten sicherstellen das Bacula bzw. das Platten System
genügend Daten liefern kann. Ansonsten kann es zum ShoeShining kommen, womit du dir das Band auf Dauer ruinierst. Zu dem noch das Spooling der Daten aktivieren!!
Aus meiner sich ist es daher einfacher im Fileset mit der maximalen gzip Kompression (9) zu Arbeiten da dann das Band auf jeden Fall genügend Daten geliefert bekommt.

Zum Thema mit nicht zurück gelieferten Band: hast du mal versucht das Band zu unmounten!! Normalerweise lässt Bacula das Band im Laufwerk so lange es noch nicht voll ist und um Zeit zu Sparen, wenn man es aber trotzdem "Rausschmeißen" will sollte das Band bzw. das Tapedrive vorher einen unmount ausführen.

Eventuell solltes du mal das changer Script per Hand Testen, manchmal macht es nicht die Sachen die es soll, bzw kann man dort Spezielle Dinge einbauen damit Bacula auch mit dem vorhandenen Changern läuft.

Sven

andy135
03.11.13, 11:38
Hallo Sven,

ich habe es inzwischen mit einem unount Script hinbekommen, dass er das Band zurück in den Slot befördert. Was die Komprimierung angeht, weiß ich nicht ob ich das richtig gemacht habe. Ich habe bei Media Type anstatt File einfach LTO-2 angegeben. Es scheint, als würde das Bandlaufwerk das dann automatisch komprimieren, denn ich habe schon über 200 GB auf das Band geschrieben, und er hat immer noch das selbe Band in Verwendung.....

Ich muß noch hinzufügen, dass ich den Autochanger gebraucht gekauft habe. Evtl. wurde da die Hardwarekomprimmierung schon aktiviert. Mit welchem Befehl kann ich das herausfinden ?

andy135
03.11.13, 22:03
Nochmal ein Nachtrag,

die Hardwarekompression schien doch nicht aktiv geschalten zu sein, nach 240GB wechselte er aufs nächste Band, aber wieso erst nach 240GB und nicht nach 200GB ? Muß ich die Hardwarekomprimierung für jedes einzelne Band aktivieren, oder geschieht dies generell einmal fürs Laufwerk ??

just4uk
04.11.13, 02:25
Ich geh mal davon aus das die Komprimierung aktiv ist.
Du darfst aber nicht erwarten da du 400GB auf ein LTO2 Band bekommst!
Das wird nur im idealsten Idealfall passieren.
Bei Overland Loadern/Libs gibts (gab!) eine Option die sich random/explizit nennt (so oder so ähnlich).
Die eine Option wartet auf Kommandos vom OS, die andere Option räumt ohne weitere Kommandos das Band nach einem umount/eject/rewind das Band wieder zurück in den Slot und legt das nächste ein.

Gruß aus L.E.
Uwe

Sven_R
04.11.13, 03:20
ich habe es inzwischen mit einem unount Script hinbekommen, dass er das Band zurück in den Slot befördert. Was die Komprimierung angeht, weiß ich nicht ob ich das richtig gemacht habe.

Wenn die Kompression schon an ist, hat das Einschalten der Kompression keine Wirkung. Mit den üblichen Befehlen kann man das Relativ schnell raus finden wie der Status des Tapes ist. Manchmal gibt aber auch Library Direkt den Status des Tape wieder, sollte aber am Tape direkt auch lösbar sein.



Ich habe bei Media Type anstatt File einfach LTO-2 angegeben. Es scheint, als würde das Bandlaufwerk das dann automatisch komprimieren, denn ich habe schon über 200 GB auf das Band geschrieben, und er hat immer noch das selbe Band in Verwendung.....

Was ist das denn überhaupt für ein Tape LTO1, 2, 3, 4, 5 oder 6???? und was für Bänder?????

Du kannst nicht einfach aus nem Tape nen Filestorage für Bacula machen das muss schief gehen. Wenn LTO 2 dann gehört auch gefälligst eine korrekte Konfig in Bacula nur so sind die Backups und der Betrieb Stabil!!!



Ich muß noch hinzufügen, dass ich den Autochanger gebraucht gekauft habe. Evtl. wurde da die Hardwarekomprimmierung schon aktiviert. Mit welchem Befehl kann ich das herausfinden ?
Durchlesen und Lernen (http://www.bacula.org/5.0.x-manuals/en/problems/problems/Testing_Your_Tape_Drive.html)
Ist aber EGAL ob an oder aus, wenn du sie eingeschaltet hast IST SIE an, es sei den das Tapedrive ist Defekt oder du hast ne SUN die gern mal dazwischen Funken sowie HP oder ganz selten mal die alten Overland Särge



die Hardwarekompression schien doch nicht aktiv geschalten zu sein, nach 240GB wechselte er aufs nächste Band, aber wieso erst nach 240GB und nicht nach 200GB ? Muß ich die Hardwarekomprimierung für jedes einzelne Band aktivieren, oder geschieht dies generell einmal fürs Laufwerk ??
Generell EINMAL AN ist IMMER AN. Es sei den die Library funkt da zwischen, sollte aber eigentlich bei Tandberg nicht der Fall sein. Tandberg baut ORDENTLICHE Librarys. Normal sollte bei 200 GB Schluß sein, oder besser 180 bis 190 GB, selbst Bacula sollte eigentlich mekkern wenn er überschreibt, eventuell hast du dir auch deine Konfig vermurkst wenn du aus nem File Storage nen Tapedrive machst.


Ich geh mal davon aus das die Komprimierung aktiv ist.
Du darfst aber nicht erwarten da du 400GB auf ein LTO2 Band bekommst!

WIEVIEL DANN ??? Wenn Laut Spezifikation LTO 2 unkomprimiert 200 GB macht und mit Kompression 400 GB?? Meinen Erfahrungen nach sollte man das Band sowieso nicht bis zum Erbrechen vollschreiben, es reicht wenn man 85 bis 90 % voll schreibt was man bei Bacula auch einstellen kann. Gerade ältere Bänder haben da manchmal Probleme wenn sie bis zum Letzten voll gepackt werden

Gerade bei Librarys mit mehreren Tapedrives können Probleme machen wenn man ein älteres Band in einem Tape Anfängt und in einem anderen weiter macht, da hab ich schon 800 GB auf ein LTO 2 Band bekommen was aber natürlich ein Defektes Archiv zur folge hatte. Wichtig ist auch das Regelmässig gereinigt wird das ist für die Leseköpfe und Bänder schon die Halbe Miete.

Sven

andy135
04.11.13, 06:23
Hallo Sven,

d.h. bei Media Type sollte dann immer generell File stehen ? Es ist ein LTO 2 Tape. Wo finde ich denn Hinweise, wie ein LTO 2 dann richitg konfiguriert wird ?

Als Bänder habe ich mal die von HP gekauft.

Habe ein paar Beispiele im Netz gefunden. Manchmal wird LTO-2 so der LTO2 so angegeben, was ist nun richtig ?

Sven_R
04.11.13, 19:37
d.h. bei Media Type sollte dann immer generell File stehen ? Es ist ein LTO 2 Tape. Wo finde ich denn Hinweise, wie ein LTO 2 dann richitg konfiguriert wird ?

NEIN, ich hab doch gesagt du kannst nicht einfach aus einem File Storage ein Tapedevice machen. Bacula behandelt Filestorage und Tapestorage völlig anders.
Wenn Filestorage dann gehört auch eine Korrekte File Konfiguration dazu und bei Tape Storage gehört eine richtige Tape Konfiguration dazu.

Sind das auch LTO 2 Drives?



Als Bänder habe ich mal die von HP gekauft.

HP ist gut die sind Robust gerade die BlueLine die weißen Tapes sind nicht ganz so robust und sind eher für SoHo.



Habe ein paar Beispiele im Netz gefunden. Manchmal wird LTO-2 so der LTO2 so angegeben, was ist nun richtig ?

Das ist egal das kann auch BLUBBBLUBB-2 heisen, wichtig ist nur das die Konfiguration zum LTO 2 Band und zum Drive passt. Da du ja beim Tapedrive die grössen mit angeben musst und das Label geht ja nicht automatisch, da es manchmal die Library macht. Genauso wie der Changer und das Mounten, das hast du ja bei einem Filestorage nicht, ausser bei einer USB Platte die erst mit Mount eingehängt wird.

Lies dir die Bacula Docu durch, die ist ziemlich gut und die Beispiele im Netz sind auch Ordentlich.

Sven

andy135
04.11.13, 19:53
Hallo Sven,

ja es sind LTO-2 Bänder. Das mit dem Spooling klappt auch inzwischen. Nur auch dort hört er erst nach ca. 26GB auf, wenn ich 25GB angebe. Ich nehm das mal nicht so übel

andy135
04.11.13, 19:59
Ach und noch was, der Befehl "mt-f / dev/nst0 compression 1" wird nicht akzeptiert....

Sven_R
04.11.13, 20:21
ist den auch das Tape unter /dev/nst0 eingehängt?? Ansonsten nimm mal die SCSI Tools damit siehst du einige wichtige Dinge unter anderem wo und wie die Tapes eingehängt sind, bzw wo sich die Library als solches eingehängt hat.

Sven

andy135
04.11.13, 20:31
Ja, das Tape ist eingehängt. Es folgt folgendes Ausgabe:


mt -f /dev/nst0 compression 1
mt: Ungültiges Argument »»compression«« für »»operation««
Gültige Argumente sind:
- `eof', `weof'
- `fsf'
- `bsf'
- `fsr'
- `bsr'
- `rewind'
- `offline', `rewoffl', `eject'
- `status'
- `bsfm'
- `eom'
- `retension'
- `erase'
- `asf'
- `fsfm'
- `seek'

andy135
04.11.13, 22:59
Hallo,

ich habe das Programm "mt-st" noch installiert und jetzt scheint es zu gehen. Jetzt kann ich mit dem Befehl: "mt -f /dev/nst0 defcompression 1" die Hardwarecompression einschalten. Was ich nicht kapier, in der man zu mt-st steht, dass man mit -1 die default compression deaktivieren kann. Wenn ich dann mit dem Befehl "cat /sys/class/scsi_tape/nst0/default_compression" abfrage kommt auch eine -1 und eine 1 bei eingeschaltet zurück. Ebenso kann ich eine 0 eingeben dann wird eine 0 zurückgegeben. Wo ist der Unterschied zwischen -1 und 0 ? Ich kann es mir zwar irgendwie denken , aber ich weiß es nicht sicher.

just4uk
05.11.13, 00:21
................WIEVIEL DANN ??? Wenn Laut Spezifikation LTO 2 unkomprimiert 200 GB macht und mit Kompression 400 GB?? Meinen Erfahrungen nach sollte man das Band sowieso nicht bis zum Erbrechen vollschreiben, es reicht wenn man 85 bis 90 % voll schreibt was man bei Bacula auch einstellen kann. Gerade ältere Bänder haben da manchmal Probleme wenn sie bis zum Letzten voll gepackt werden.......Was soll den an einem eh schon komprimiertem File noch komprimiert werden? Da kann die beste Hardwarekomprimierung nix mehr komprimieren und ist bei 200GB Schluss. Im dümmsten Fall kann es auch mal passieren das "nur" (willkürliche Zahl) 190GB auf ein Band passen. Geht mal von einer Komprimierungsrate von 1,2 - 1,5 aus im dem Bereich dürfte alles drin sein. Seit TK88/89 hör ich immer wieder "ja aber mit Komprimierung passt das doppelte drauf" und seit genau dieser Zeit passt eben nicht das dopplete drauf! Es mag ja mal sein das jemand 400GB Textfile auf ein LTO2 bekommt aber Sorry nicht im realen Leben!

Gruß aus L.E.
Uwe

Sven_R
05.11.13, 13:13
Was soll den an einem eh schon komprimiertem File noch komprimiert werden? Da kann die beste Hardwarekomprimierung nix mehr komprimieren und ist bei 200GB Schluss.

Richtig, da muss man dann eben Bacula sagen das der nichts mehr komprimieren soll, dann hat das Band die Chance mit der Kompression zu Arbeiten.



Im dümmsten Fall kann es auch mal passieren das "nur" (willkürliche Zahl) 190GB auf ein Band passen. Geht mal von einer Komprimierungsrate von 1,2 - 1,5 aus im dem Bereich dürfte alles drin sein.

Auch Richtig, daher werden neue Bänder auch mehrfach in unterschiedlichen Tapedrives getestet. Daher hab ich mir angewöhnt auch nur 85 bis 90 % des Bandes zu nutzen.



Seit TK88/89 hör ich immer wieder "ja aber mit Komprimierung passt das doppelte drauf" und seit genau dieser Zeit passt eben nicht das dopplete drauf! Es mag ja mal sein das jemand 400GB Textfile auf ein LTO2 bekommt aber Sorry nicht im realen Leben!

Das kommt auch drauf an wie gut die Bänder sind und wie gut die Hardware Komprimieren kann, bei einem MPEG4 nutzt auch die Hardwarekompression nicht wirklich was. Ich hab es auch schon mal geschafft 800 GB auf ein LTO 2 Tape zu schreiben was aber nur Datenmüll beim Recover erzeugt hat und Bacula das Tape nicht mehr richtig lesen konnte.

Daher bei mir KEINE Hardware Kompression statt dessen Bacula alles Komprimieren lassen, was ja auch schon den Traffic reduziert und die Bänder nur maximal 90 % voll schrieben.

Sven

andy135
05.11.13, 21:38
Hallo jetzt ist mir grad irgendwie ein anderer Fehler unterlaufen. Nachdem ich gestern das Band in Slot1 mit mt -f /dev/nst0 erase mal gelöscht habe, habe ich noch ein mt -f /dev/nst0 weof gemacht. Aber irgendwie will er es nicht mehr labeln. Es kommt immer die Fehlermeldung

Storage name given twice.

Die Bänder in Slot 2 und 3 werden richtig in den Pool gelabelt

andy135
05.11.13, 23:24
Habs wieder hinbekommen, indem ich die MySQL zurück gesetzt habe. Bin ja noch im Testmodus und nicht im Produdktivmodus ;-)

andy135
05.11.13, 23:34
Nein, geht doch noch nicht. Nachdem zurücksetzen der Datenbank und einem Backup des MyCatalogs hat die Datenbank immer noch "Last Volume Bytes: 176,732,782 (176.7 MB)". Jetzt hat Slot 1 funktioniert zu labeln, aber jetzt meckert er an Slot3 rum, obwohl auch da zuvor mt -f /dev/nst0 weof ausgeführt wurde. Nach dem Labeln kommt immer: Storage name given twice, obwohl dieser nur einmal in den configs vorkommt.

andy135
05.11.13, 23:43
Meine SD Config:


# "Media Type" in the Device resource, please ensure
# that dird.conf has corresponding changes.
#

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




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

#
# Restricted Director, used by tray-monitor to get the
# status of the storage daemon
#
Director {
Name = linuxserv-mon
Password = "eFVYmDBEPmQT735gDTYuScccv0zvwMdEp"
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/viewvc/bacula/trunk/bacula/examples/devices/
#

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

Device {
Name = FileStorage
Media Type = File
Archive Device = /backup
LabelMedia = yes; # lets Bacula label unlabeled media
#LabelFormat = "catalog-"
Random Access = Yes;
AutomaticMount = yes; # when device opened, read it
RemovableMedia = no;
AlwaysOpen = no;
#Pool = Default
}


Device {
Name = arsch
Media Type = File
Archive Device = /backup/usbstick
LabelMedia = yes # lets Bacula label unlabeled media
Random Access = yes
RemovableMedia = yes
AutomaticMount = yes
AlwaysOpen = no
#Requires Mount = yes
#Mount Point = /mnt/usb-platte
#Mount Command = "/bin/mount -t vfat /dev/disk/by-uuid/68BA-AA13 %m"
}

Device {
Name = Rauscher7
Media Type = File
Archive Device = /backup/Rauscher7
LabelMedia = yes
Random Access = yes
RemovableMedia = yes
Automaticmount = yes
AlwaysOpen = no

}

#
# An autochanger device with two drives
#
#Autochanger {
# Name = Autochanger
# Device = Drive-1
# Device = Drive-2
# Changer Command = "/etc/bacula/scripts/mtx-changer %c %o %S %a %d"
# Changer Device = /dev/sg0
#}

#Device {
# Name = Drive-1 #
# Drive Index = 0
# Media Type = DLT-8000
# Archive Device = /dev/nst0
# AutomaticMount = yes; # when device opened, read it
# AlwaysOpen = yes;
# RemovableMedia = yes;
# RandomAccess = no;
# AutoChanger = yes
# #
# # Enable the Alert command only if you have the mtx package loaded
# # Note, apparently on some systems, tapeinfo resets the SCSI controller
# # thus if you turn this on, make sure it does not reset your SCSI
# # controller. I have never had any problems, and smartctl does
# # not seem to cause such problems.
# #
# Alert Command = "sh -c 'tapeinfo -f %c |grep TapeAlert|cat'"
# If you have smartctl, enable this, it has more info than tapeinfo
# Alert Command = "sh -c 'smartctl -H -l error %c'"
#}

#Device {
# Name = Drive-2 #
# Drive Index = 1
# Media Type = DLT-8000
# Archive Device = /dev/nst1
# AutomaticMount = yes; # when device opened, read it
# AlwaysOpen = yes;
# RemovableMedia = yes;
# RandomAccess = no;
# AutoChanger = yes
# # Enable the Alert command only if you have the mtx package loaded
# Alert Command = "sh -c 'tapeinfo -f %c |grep TapeAlert|cat'"
# If you have smartctl, enable this, it has more info than tapeinfo
# Alert Command = "sh -c 'smartctl -H -l error %c'"
#}

#
# A Linux or Solaris LTO-2 tape drive
#

Autochanger {
Name = "Tandberg"
#Device = DDS-4
Device = Drive1
Changer Device = /dev/sg3
Changer Command = "/etc/bacula/scripts/mtx-changer %c %o %S %a %d"
}


Device {
Name = Drive1
Media Type = LTO-2
Drive Index = 0
Archive Device = /dev/nst0
#Archive Device = /dev/sg3
LabelMedia = no
AutomaticMount = yes; # when device opened, read it
AlwaysOpen = no;
RemovableMedia = yes;
RandomAccess = no;
Spool Directory = /home/andeslap/sdb/baculaspool
Maximum Spool Size = 25GB
#Maximum Job Spool Size = 25G
#Maximum File Size = 200GB
#Changer Command = "/etc/bacula/scripts/mtx-changer %c %o %S %a %d"
# Changer Device = /dev/sg0 --> original
Changer Device = /dev/sg3
# AutoChanger = yes
AutoChanger = yes
# Enable the Alert command only if you have the mtx package loaded
# Alert Command = "sh -c 'tapeinfo -f %c |grep TapeAlert|cat'"
# If you have smartctl, enable this, it has more info than tapeinfo
# Alert Command = "sh -c 'smartctl -H -l error %c'"
}

#
# A Linux or Solaris LTO-3 tape drive
#
#Device {
# Name = LTO-3
# Media Type = LTO-3
# Archive Device = /dev/nst-1
# AutomaticMount = yes; # when device opened, read it
# AlwaysOpen = yes;
# RemovableMedia = yes;
# RandomAccess = no;
# Maximum File Size = 4GB
## Changer Command = "/etc/bacula/scripts/mtx-changer %c %o %S %a %d"
## Changer Device = /dev/sg0
## AutoChanger = yes
# # Enable the Alert command only if you have the mtx package loaded
## Alert Command = "sh -c 'tapeinfo -f %c |grep TapeAlert|cat'"
## If you have smartctl, enable this, it has more info than tapeinfo
## Alert Command = "sh -c 'smartctl -H -l error %c'"
#}

#
# A Linux or Solaris LTO-4 tape drive
#
#Device {
# Name = LTO-4
# Media Type = LTO-4
# Archive Device = /dev/nst0
# AutomaticMount = yes; # when device opened, read it
# AlwaysOpen = yes;
# RemovableMedia = yes;
# RandomAccess = no;
# Maximum File Size = 5GB
## Changer Command = "/etc/bacula/scripts/mtx-changer %c %o %S %a %d"
## Changer Device = /dev/sg0
## AutoChanger = yes
# # Enable the Alert command only if you have the mtx package loaded
## Alert Command = "sh -c 'tapeinfo -f %c |grep TapeAlert|cat'"
## If you have smartctl, enable this, it has more info than tapeinfo
## Alert Command = "sh -c 'smartctl -H -l error %c'"
#}




#
# A FreeBSD tape drive
#
#Device {
# Name = DDS-4
# Description = "DDS-4 for FreeBSD"
# Media Type = DDS-4
# Archive Device = /dev/nsa1
# AutomaticMount = yes; # when device opened, read it
# AlwaysOpen = yes
# Offline On Unmount = no
# Hardware End of Medium = no
# BSF at EOM = yes
# Backward Space Record = no
# Fast Forward Space File = no
# TWO EOF = yes
# If you have smartctl, enable this, it has more info than tapeinfo
# Alert Command = "sh -c 'smartctl -H -l error %c'"
#}

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


Und meine Dir-config:


#
# 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 5.2.5 (26 January 2012) -- ubuntu 12.04
#
# 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.
#

Director { # define myself
Name = linuxserv-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 = "1122334455" # Console password
Messages = Daemon
#DirAddress = 127.0.0.1
#DirAddress = 192.168.0.200
}

JobDefs {
Name = "DefaultJob"
Type = Backup
Level = Incremental
Client = linuxserv-fd
FileSet = "Full Set"
Schedule = "WeeklyCycle"
Storage = FileStorage
Messages = Standard
Pool = File
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 = "BackupClient1"
# JobDefs = "DefaultJob"
#}

#Job {
# Name = "BackupClient2"
# Client = linuserv2-fd
# JobDefs = "DefaultJob"
#}

# Backup the catalog database (after the nightly save)
Job {
Name = "BackupCatalog"
JobDefs = "DefaultJob"
Level = Full
FileSet="Catalog"
Schedule = "WeeklyCycleAfterBackup"
Pool = Default
Client = linuxserv-fd
# 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"
#RunAfterJob = "/backup/beep.sh"

#RunAfterJob = "/backup/pcaus.sh"
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=linuxserv-fd
FileSet="Full Set"
Storage = FileStorage
Pool = Default
Messages = Standard
Where = /nonexistant/path/to/file/archive/dir/bacula-restores
}

Job {
Name = "arubuntu"
Type = Backup
#JobDefs ="DefaultJob"
Client = arubuntu-fd
FileSet = "arubuntu Set"
Storage = FileStorage
Schedule = "WeeklyCycle"
Messages = Standard
Pool = File
Full Backup Pool = Full
Differential Backup Pool = Diff
Incremental Backup Pool = Incr
#RunAfterJob = "shutdown -h now"
Priority = 2
}


Job {
Name = "usbstick"
Level = Full
Type = Backup
#JobDefs ="DefaultJob"
Client = linuxserv-fd
FileSet = "usbstick Set"
#Storage = FileStorage
Storage = arsch
#Schedule = "WeeklyCycle"
Messages = Standard
Pool = usbstick
#Full Backup Pool = Full
#Differential Backup Pool = Diff
#Incremental Backup Pool = Incr
RunAfterJob = "/backup/beep_gut.sh"
RunAfterFailedJob = "/backup/beep_schlecht.sh"
Priority = 3
}

Job {
Name = "Rauscher7"
Type = Backup
Client = Rauscher7-fd
FileSet = "Rauscher7 Set"
Storage = Tandberg
Schedule = "WeeklyCycle"
Spool Data = yes
Spool Size = 25GB
Messages = Standard
Pool = LTO2-Rauscher7
RunAfterJob = "/backup/mount.sh"
Priority = 1
}

#Job {
# Name = "usbstick"
# Type = Backup
# Level = Incremental
# #Client = usbstick-fd
# FileSet = "usbstick Set"
# Pool = usbstick
# Storage = usbstick-sd
# Messages = Standard
# Priority = 2
#}

# 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 = /.journal
File = /.fsck
}
}

FileSet {
Name = "arubuntu Set"
Include {
Options {
signature = MD5
}
File = /home/arubuntu/Dokumente/Technikerschule
}
}

FileSet {
Name = "usbstick Set"
Include {
Options {
signature = MD5
}
File = /home/andeslap/usbstick
}
}

FileSet {
Name = "Rauscher7 Set"
Include {
Options {
signature = MD5
}
File = c:/Users/Rauscher7/Documents
File = d:/
}
Exclude {
File = d:/arauscherxp
File = d:/Acronis True Image 9 server
File = d:/Brennprogramm
File = /home/andeslap/sdb/baculaspool
}
}

#
# 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 sun at 22:00
Run = Differential 2nd-5th sun at 22:00
Run = Incremental mon-sat at 22:00
}

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

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

# Client (File Services) to backup
Client {
Name = linuxserv-fd
Address = 192.168.0.200
FDPort = 9102
Catalog = MyCatalog
Password = "22222" # password for FileDaemon
File Retention = 30 days # 30 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 = linuserv2-fd
# Address = localhost2
# FDPort = 9102
# Catalog = MyCatalog
# Password = "kVBelVdS-w-5qWfhRRCLA1Jit98gryOq_2" # password for FileDaemon 2
# File Retention = 30 days # 30 days
# Job Retention = 6 months # six months
# AutoPrune = yes # Prune expired Jobs/Files
#}


Client {
Name = arubuntu-fd
Address = 192.168.0.201
FDPort = 9102
Catalog = MyCatalog
Password = "22222"
File Retention = 30 days
Job Retention = 6 month
AutoPrune = yes

}
#Client {
# Name = "usbstick-fd"
# Address = 192.168.0.200
# FDPort = 9102
# Catalog = MyCatalog
# Password = 22222"
# File Retention = 30 days
# Job Retention = 6 month
# AutoPrune = yes
#}


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

# Definition of file storage device
Storage {
Name = FileStorage
# Do not use "localhost" here
Address = 192.168.0.200 # N.B. Use a fully qualified name here
SDPort = 9103
Password = "11111"
Device = FileStorage
Media Type = File
}

Storage {
Name = arsch
#Name = FileStorage
Address = 192.168.0.200
SDPort = 9103
Password = "11111"
Device = arsch
Media Type = File
}

#Storage {
# Name = Rauscher7
# Address = 192.168.0.200
# SDPort = 9103
# Password = "11111"
# Device = Rauscher7
# MediaType = File
#}

Storage {

Name = Tandberg
Address = 192.168.0.200
SDPort = 9103
Password = "11111"
Device = Drive1
Media Type = LTO-2
Autochanger = yes

}

#Autochanger {
# Name = Tandberg
# Device = Drive-1
# Changer Command = "/usr/lib/bacula/

# Definition of DDS tape storage device
#Storage {
# Name = DDS-4
# Do not use "localhost" here
# Address = localhost # N.B. Use a fully qualified name here
# SDPort = 9103
# Password = "EsfBEDIB5ikt3XzC_esffxHKagKT41dIG" # password for Storage daemon
# Device = DDS-4 # must be same as Device in Storage daemon
# Media Type = DDS-4 # must be same as MediaType in Storage daemon
# Autochanger = yes # enable for autochanger device
#}

# Definition of 8mm tape storage device
#Storage {
# Name = "8mmDrive"
# Do not use "localhost" here
# Address = localhost # N.B. Use a fully qualified name here
# SDPort = 9103
# Password = "EsfBEDIB5ikt3XzC_esffxHKagKT41dIG"
# Device = "Exabyte 8mm"
# MediaType = "8mm"
#}

# Definition of DVD storage device
#Storage {
# Name = "DVD"
# Do not use "localhost" here
# Address = localhost # N.B. Use a fully qualified name here
# SDPort = 9103
# Password = "EsfBEDIB5ikt3XzC_esffxHKagKT41dIG"
# Device = "DVD Writer"
# MediaType = "DVD"
#}


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

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


# Message delivery for daemon messages (no job).
Messages {
Name = Daemon
mailcommand = "/usr/lib/bacula/bsmtp -h localhost -f \"\(Bacula\) \%r\>\" -s \"Bacula daemon message\" %r"
mail = andeslap@linuxserv.netzmafia.home = all, !skipped
console = all, !skipped, !saved
append = "/var/lib/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
Label Format = "catalog-"
}

# 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

}


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

Pool {
Name = Full
Pool Type = Backup
Recycle = yes
AutoPrune = yes
Volume Retention = 1 year
LabelFormat = "arubuntuFull-"
}

Pool {
Name = Diff
Pool Type = Backup
Recycle = yes
AutoPrune = yes
Volume Retention = 3 month
LabelFormat = "arubuntuDiff-"
}
Pool {
Name = Incr
Pool Type = Backup
Recycle = yes
AutoPrune = yes
Volume Retention = 3 weeks
LabelFormat = "arubuntuIncr-"
}

Pool {
Name = usbstick
Pool Type = Backup
Recycle = yes
AutoPrune = yes
#Volume Retention = 3 month
Volume Use Duration = 1h
LabelFormat = "usbstick-${Day}-${Month}-${Year}--${Hour}:${Minute}"
#LabelFormat = "Vol"
}

Pool {
Name = Rauscher7
Pool Type = Backup
Recycle = yes
AutoPrune = yes
Volume Retention = 3 month
Volume Use Duration = 23h
LabelFormat = "Rauscher7-${Year}-${Month:p/2/0/r}-${Day:p/2/0/r}}"
}

Pool {

Name = LTO2-Rauscher7
Pool Type = Backup
Recycle = yes
AutoPrune = yes
Volume Retention = 3 month
# LabelFormat = "Rauscher7-LTO2-"
}
#
# Restricted console used by tray-monitor to get the status of the director
#
Console {
Name = linuserv-mon
Password = "hfuA_cHn71y7PCedEeJ6tsYypBCKMUXCG"
CommandACL = status, .status
}

Sven_R
06.11.13, 13:48
Nein, geht doch noch nicht. Nachdem zurücksetzen der Datenbank und einem Backup des MyCatalogs hat die Datenbank immer noch "Last Volume Bytes: 176,732,782 (176.7 MB)".

Hast du die ".state" Dateien auch gelöscht?? Bacula merkt sich nämlich damit wo er gerade gewesen ist.
Wie hast du die DB geleert?? Gelöscht und dann make_catalog gemacht??



Jetzt hat Slot 1 funktioniert zu labeln, aber jetzt meckert er an Slot3 rum, obwohl auch da zuvor mt -f /dev/nst0 weof ausgeführt wurde. Nach dem Labeln kommt immer: Storage name given twice, obwohl dieser nur einmal in den configs vorkommt.

Hast du in der Konfig festgesetzt welches Drive Labeln darf??
Was hast du eigentlich für eine Library??
Wieviel Tapedrives und Bänder sind da drin.

Hier mal eine alte Konfig die bei mir so gelaufen ist allerdings mit LTO 3 einem Changer und 6 Tapedrives. Dafür aber 1500 Tapes.

Du musst natürlich die Pfade der Devices des Changers und die Changer Scripte anpassen. Entsprechend sollte dann auch auf der Konsole die Werte vom mtx-changer getestet werden. Je nach Changer bzw. Library müssen das andere oder mehr sein. Da Hilft nur Testen. Des Weiteren kannst du nit der bconsole das ganze Testen, da Bacula das gleiche macht wie ohne Konsole. Wenn es mit der bconsole nicht geht dann geht auch der Bacula run nachher nicht so wie er soll.

Am besten vorher noch mal alle Tapes Wipen damit Bacula da nicht andere Container oder Labels findet und durcheinander kommt. Wenn deine Library Label kann solltest du vorher Testen ob die Bacula auch zuverlässig erkennt. Auf einigen alten StorageTek SL500 hat das manchmal Probleme gemacht daher hab ich dann Bacula ein Drive vorgegeben wo der Labeln darf und hat dann eigene Lables auf die Tapes geschrieben. Wichtig ist auch noch das du zuverlässig weisst wie viel wirklich auf die Tapes passt und die Dinger nicht bis zum Erbrechen voll machst. Wie gesagt 80 bis 90 % reichen aus. Wenn du Bacula das in der Media Konfig mit gibst sollte das Perfekt passen.



Autochanger {
Name = LTO-3
Device = Drive-1, Drive-2, Drive-3, Drive-4, Drive-5, Drive-6
Changer Command = "/usr/local/bacula/bin/mtx-changer %c %o %S %a %d"
Changer Device = /dev/sg26
}

Device {
Name = Drive-1
Drive Index = 0
Media Type = LTO-3
Device Type = Tape
Archive Device = /dev/st0
AutomaticMount = yes;
AlwaysOpen = yes;
RemovableMedia = yes;
RandomAccess = no;
AutoChanger = yes
Autoselect = yes
Alert Command = "sh -c 'tapeinfo -f %c |grep TapeAlert|cat'"
}

Device {
Name = Drive-2
Drive Index = 1
Media Type = LTO-3
Device Type = Tape
Archive Device = /dev/st1
AutomaticMount = yes;
AlwaysOpen = yes;
RemovableMedia = yes;
RandomAccess = no;
AutoChanger = yes
Autoselect = yes
Alert Command = "sh -c 'tapeinfo -f %c |grep TapeAlert|cat'"
}

Device {
Name = Drive-3
Drive Index = 2
Media Type = LTO-3
Device Type = Tape
Archive Device = /dev/st2
AutomaticMount = yes;
AlwaysOpen = yes;
RemovableMedia = yes;
RandomAccess = no;
AutoChanger = yes
Autoselect = yes
Alert Command = "sh -c 'tapeinfo -f %c |grep TapeAlert|cat'"
}

Device {
Name = Drive-4
Drive Index = 3
Media Type = LTO-3
Device Type = Tape
Archive Device = /dev/st3
AutomaticMount = yes;
AlwaysOpen = yes;
RemovableMedia = yes;
RandomAccess = no;
AutoChanger = yes
Autoselect = yes
Alert Command = "sh -c 'tapeinfo -f %c |grep TapeAlert|cat'"
}

Device {
Name = Drive-5
Drive Index = 4
Media Type = LTO-3
Device Type = Tape
Archive Device = /dev/st4
AutomaticMount = yes;
AlwaysOpen = yes;
RemovableMedia = yes;
RandomAccess = no;
AutoChanger = yes
Autoselect = yes
Alert Command = "sh -c 'tapeinfo -f %c |grep TapeAlert|cat'"
}

Device {
Name = Drive-6
Drive Index = 5
Media Type = LTO-3
Device Type = Tape
Archive Device = /dev/st5
AutomaticMount = yes;
AlwaysOpen = yes;
RemovableMedia = yes;
RandomAccess = no;
AutoChanger = yes
Autoselect = yes
Alert Command = "sh -c 'tapeinfo -f %c |grep TapeAlert|cat'"
}

Pool {
Name = LTO-3
Pool Type = Backup
Recycle = yes
AutoPrune = yes
Volume Retention = 365 days
Cleaning Prefix = "CLN"
}

JobDefs {
#Name = "Linux_Server"
Name = "Tape Library"
Type = Backup
Level = Full
Client = grosser-fd
FileSet = "Linux_Server"
Schedule = "WeeklyCycle"
Storage = LTO-3
Messages = Standard
Pool = LTO-3
Priority = 10
Prefer Mounted Volumes = no # Finding an unused drive, otherwise, job started will append to volume.
}


Sven

andy135
06.11.13, 15:25
Hallo Sven,

ich glaube ich habe das Hauptproblem in meiner SD gefunden.. Ich habe zweimal einen Storage definiert. Einmal den Autochanger und einmal den linuxserv-dir ganz oben in der SD. Reicht eigentlich nur die Autochanger Ressource und wenn ja, kann ich da mit dem gleichen SD auch Festplattenbackups laufen lassen ?

Sven_R
06.11.13, 16:23
JA, der SD kann alles was du willst. Solange des Ordentlich aufgebaut ist.
Du kannst auch 10 Librarys anschliessen und 20 PB NAS/SAS/DAS, DVD, USB-Sticks oder wie auch immer. Solange der SD genügend Ressourcen hat kannst du anbauen was du willst.

Bei einigen meiner SD habe ich über SCSI 4 Librarys gesteuert, die hat war ganz schon viel IO zum Spoolen benötigt, konnte aber 4 LTO 4 Drives mit knapp 6000 Tapes bedienen.

Die Autochanger Ressource allein reicht nicht. Wenn du eine Library hast musst du immer die Tapes und Library zusammen Einbauen. Nur die Tapes geht mit einer Library nicht aber auch die Library ohne Tapes geht nicht.

Du musst ja schließlich der Library sagen welches Tape du haben willst und die holt das Band aus dem Schacht und Transportiert es hin und her.
Wenn du natürlich nur ein Tapedrive hast kannst du ja keine Library Steuern, damit steht das Tapedrive allein in der Konfig und wird von Bacula ähnlich wie ein DVD Laufwerk behandelt.
Es gibt sogar Pseudo Library Scripte die eine Mail schicken damit du das Band wechselst, wird aber in der Bacula Konfig wie eine Library aufgebaut nur das der Changer dir eine Mail schickt statt den Roboterarm zu bewegen.

Sven

andy135
06.11.13, 17:34
Hallo Sven,

mit Tapes meinst Du sicherlich die Device Ressourcen ??? ? Ich meinte, dass meine 2. Storageangabe, der linuxserv-dir mit ein Problem ist. Werde ich heute abend mal testen wenn ich zu Hause bin.

Ich habe einen von Tandberg StorageLoader 1U mit 8 Slots und einem Laufwerk. Die Datenbank habe ich mit dem Befehl "drop databases bacula " und dann mit dem dpkg reconfigure neu eingelesen/gestellt. Weiß nicht ob das optimal ist. Aber die Fehlermeldung dass beim Labeln der Bänder zwei Storages vorhanden sind, liegt meine Vermutung schon sehr nahe, dass der linuxserv-dir zuviel konfiguriert ist. Den habe ich genommen, als ich noch mein Bandlaufwerk nicht hatte und nur auf Festplatte meine Backups gemacht habe.

andy135
06.11.13, 19:17
Jetzt habe ich mal den 2. sd auskommentiert und bacula-sd neugestartet und dann kommt die Felhermeldung: "/usr/sbin/btraceback: 42: /usr/sbin/btraceback: gdb: not found".
Scheint man doch zu brauchen... Ich weiß mir nicht mehr weiter, wieso komm immer beim Labeln die Meldunug Storage Name given twice...

Zum Thema .state Dateien: nein die habe ich nicht gelöscht. Wie geht das bzw. in welchem Verzeichnis liegen diese Dateien....

andy135
06.11.13, 21:31
ich habe beim Löschen der Datenbank zu viel vermurkst. Jetzt gibts ne Neuinstallation. Melde mich dann wieder...