Bacula:存储配置错误

Bacula:存储配置错误

首先,如果这个问题看起来微不足道,我很抱歉,但这是我第一次安装 Bacula。

安装程序是在运行标准 Debian 存储库的 Debian 10.2 和 Bacula 9.4.4(社区)的物理机上进行的。

我有一个可以自己运行的配置,但是在单个卷上。因此,基于一些文档模板,我准备了一个更简单的配置(按主机划分并分布在多个卷上),但我一定是做错了什么。

  • “bacula-sd -tc /etc/bacula/bacula-sd.conf”通过了所有测试
  • “bacula-fd -tc /etc/bacula/bacula-fd.conf”通过了所有测试
  • “bacula-dir -tc /etc/bacula/bacula-dir.conf”告诉我

“19-feb 22:26 bacula-dir: parse_conf.c:636 处发生错误终止配置错误:找不到第 40 行引用的配置资源“DummyPool”: Storage = DummyPool

:文件 /etc/bacula/bacula-dir.conf 第 40 行,第 22 列 Storage = DummyPool”

但我确信我在 bacula-dir.conf 的第 279 行声明了池,并且该目录在我看来在 bacula-sd.conf 中配置正确

bacula-dir.conf

#############################################################################################
#                                   Server Section
#############################################################################################

Director {                            # define myself
  Name = SRV-Debian-ATB-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 = "Gxq6T-81ek3S_FccNF23s1sTY_jcnZEJv"         # Console password
  Messages = Daemon
  DirAddress = 127.0.0.1
}


#############################################################################################
#                                   Client(s) Section
#############################################################################################

# bacula itself
@/etc/bacula/bacula-dir_bacula.conf

# other client(s)
#@/etc/bacula/bacula-dir_wks1.conf
#@/etc/bacula/bacula-dir_client2.conf
#@/etc/bacula/bacula-dir_client3.conf
#@/etc/bacula/bacula-dir_client4.conf
#@/etc/bacula/bacula-dir_client5.conf


#############################################################################################
#                               Standard Restore template
#############################################################################################
Job {
  Name = "RestoreLocalFiles"
  Type = Restore
  Client=SRV-Debian-ATB-fd
  Storage = DummyPool
# The FileSet and Pool directives are not used by Restore Jobs
# but must not be removed
  FileSet="Full Set"
  Pool = BaculaFileStorage
  Messages = Standard
  Where = /mnt/bacula/restore
}


#############################################################################################
#                                       Fileset(s)
#############################################################################################

###########################
##   Bacula FileSet
###########################

FileSet {
  Name = "Catalog"
  Include {
    Options {
      signature = MD5
    }
    File = "/var/lib/bacula/bacula.sql"
  }
}


FileSet {
  Name = "Full Set"
  Include {
    Options {
      signature = MD5
      compression = GZIP
    }
    File = /
  }
  Exclude {
    File = /var/lib/bacula
    File = /mnt/bacula/restore
    File = /mnt/bacula/backup
    File = /proc
    File = /tmp
    File = /sys
    File = /.journal
    File = /.fsck
  }
}

###########################
##   Windows FileSet
###########################

FileSet {
    Name = "Windows Client Defined"
    Include {
        Options {
            signature = MD5
            compression = gzip
            IgnoreCase = yes
            Exclude = yes
            # Exclude junction points
            WildDir = "[A-Z]:/Documents and Settings"
            #WildDir = "[A-Z]:/Program Files/File comuni"
            WildDir = "[A-Z]:/Program Files/Windows NT/Accessori"
            #WildDir = "[A-Z]:/ProgramData/Application Data"
            #WildDir = "[A-Z]:/ProgramData/Dati applicazioni"
            WildDir = "[A-Z]:/ProgramData/Documenti"
            WildDir = "[A-Z]:/ProgramData/Documents"
            WildDir = "[A-Z]:/ProgramData/Favorites"
            WildDir = "[A-Z]:/ProgramData/Menu Avvio"
            WildDir = "[A-Z]:/ProgramData/Microsoft/Windows/Start Menu/Programmi"
            WildDir = "[A-Z]:/ProgramData/Preferiti"
            WildDir = "[A-Z]:/ProgramData/Start Menu"
            WildDir = "[A-Z]:/ProgramData/Templates"
            WildDir = "[A-Z]:/Programmi"
            WildDir = "[A-Z]:/Users/Administrator/AppData/Local/Cronologia"
            WildDir = "[A-Z]:/Users/Administrator/AppData/Local/Dati applicazioni"
            WildDir = "[A-Z]:/Users/Administrator/AppData/Local/Temporary Internet Files"
            WildDir = "[A-Z]:/Users/Administrator/AppData/Roaming/Microsoft/Windows/Start Menu/Programmi"
            WildDir = "[A-Z]:/Users/Administrator/Dati applicazioni"
            WildDir = "[A-Z]:/Users/Administrator/Documenti"
            WildDir = "[A-Z]:/Users/Administrator/Impostazioni locali"
            WildDir = "[A-Z]:/Users/Administrator/Menu Avvio"
            WildDir = "[A-Z]:/Users/Administrator/Risorse di rete"
            WildDir = "[A-Z]:/Users/Administrator/Risorse di stampa"
            WildDir = "[A-Z]:/Users/All Users"
            WildDir = "[A-Z]:/Users/Default/AppData/Local/Application Data"
            WildDir = "[A-Z]:/Users/Default/AppData/Local/Cronologia"
            WildDir = "[A-Z]:/Users/Default/AppData/Local/Dati applicazioni"
            WildDir = "[A-Z]:/Users/Default/AppData/Local/Temporary Internet Files"
            WildDir = "[A-Z]:/Users/Default/AppData/Roaming/Microsoft/Windows/Start Menu/Programmi"
            WildDir = "[A-Z]:/Users/Default/Application Data"
            WildDir = "[A-Z]:/Users/Default/Dati applicazioni"
            WildDir = "[A-Z]:/Users/Default/Documenti"
            WildDir = "[A-Z]:/Users/Default/Documents/My Music"
            WildDir = "[A-Z]:/Users/Default/Documents/My Pictures"
            WildDir = "[A-Z]:/Users/Default/Documents/My Videos"
            WildDir = "[A-Z]:/Users/Default/Impostazioni locali"
            WildDir = "[A-Z]:/Users/Default/Local Settings"
            WildDir = "[A-Z]:/Users/Default/Menu Avvio"
            WildDir = "[A-Z]:/Users/Default/My Documents"
            WildDir = "[A-Z]:/Users/Default/PrintHood"
            WildDir = "[A-Z]:/Users/Default/Risorse di rete"
            WildDir = "[A-Z]:/Users/Default/Risorse di stampa"
            WildDir = "[A-Z]:/Users/Default/Start Menu"
            WildDir = "[A-Z]:/Users/Default/Templates"
            WildDir = "[A-Z]:/Users/Default User"
            WildDir = "[A-Z]:/Users/Public/Documents/My Music"
            WildDir = "[A-Z]:/Users/Public/Documents/My Pictures"
            WildDir = "[A-Z]:/Users/Public/Documents/My Videos"
            WildDir = "[A-Z]:/Users/Utente/AppData/Local/Cronologia"
            WildDir = "[A-Z]:/Users/Utente/AppData/Local/Dati applicazioni"
            WildDir = "[A-Z]:/Users/Utente/AppData/Local/Temporary Internet Files"
            WildDir = "[A-Z]:/Users/Utente/AppData/Roaming/Microsoft/Windows/Start Menu/Programmi"

            # Temporary directories & files
            WildDir = "[A-Z]:/Windows/Temp"
            WildDir = "[A-Z]:/Temp"
            WildFile = "*.tmp"
            WildDir = "[A-Z]:/tmp"
            WildDir = "[A-Z]:/var/tmp"
            WildDir = "[A-Z]:/Users/*/AppData/Local/Mozilla/Firefox/Profiles/*/Cache"

            # Recycle bins
            WildDir = "[A-Z]:/$Recycle.Bin"
            WildDir = "[A-Z]:/RECYCLER"

            # Swap files
            WildFile = "[A-Z]:/pagefile.sys"
            WildFile = "[A-Z]:/swapfile.sys"
            WildFile = "[A-Z]:/hiberfile.sys"
        }
    File = "C:/"
    #File = "\\<C:/Program Files/Bacula/scripts/bacula_include.txt"
   }
   Exclude {
    #File = "\\<C:/Program Files/Bacula/scripts/bacula_exclude.txt"
   }
}

#############################################################################################
#                              Schedule(s)
#############################################################################################

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

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


#############################################################################################
#                                  Storage(s)
#############################################################################################

Storage {
  Name = DummyFileStorage
# Do not use "localhost" here
  Address = 192.168.1.6                           # N.B. Use a fully qualified name here
  SDPort = 9103
  Password = "tWYtlyJ3uw7x_YTXODfbcs9iGz-NZRU8l"
  Device = DummyDir
  Media Type = FileDummy
  Maximum Concurrent Jobs = 10                    # run up to 10 jobs a the same time
}

############################################################################################## 
#                             Generic catalog service
#############################################################################################

Catalog {
  Name = MyCatalog
  dbname = "bacula"; DB Address = "localhost"; dbuser = "bacula"; dbpassword = "sFOqIJ5gpFIJ"
}

#############################################################################################
#                                Message Delivery
#############################################################################################


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 '[email protected]', 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"

# Uncommenting the following two lines makes bacula send mail job reports via local zimbra server
 #  mailcommand = "/usr/lib/bacula/bsmtp -h zimbra1.alessiotubi.it -f \"ATB Bacula \<[email protected]\>\" -s \"Bacula: %t %e of %c %n %l\" %r"
 #  operatorcommand = "/usr/lib/bacula/bsmtp -h zimbra1.alessiotubi.it -f \"ATB Bacula \<[email protected]\>\" -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
}


# Pool Dummy
Pool {
 Name = DummyPool
 Pool Type = Backup
 Recycle = yes
 AutoPrune = no
 Volume Retention = 1 day
 Recycle Current Volume = yes
 Recycle Oldest Volume = yes
 #Maximum Volume Jobs = 7
 Label Format = "DUMMY-"
}

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

#
# Restricted console used by tray-monitor to get the status of the director
#
Console {
  Name = SRV-Debian-ATB-mon
  Password = "x9lZYX-HsFsm0FBdrpn4G20uLzAhcVHJy"
  CommandACL = status, .status
}

bacula-dir_bacula.conf

#############################################################################################
#                                       Client
#############################################################################################

# Bacula Server
Client {
  Name = SRV-Debian-ATB-fd
  Address = localhost
  FDPort = 9102
  Catalog = MyCatalog
  Password = "uHW41P3yNT31oeX2O0DDcrmKAlnaur_fW"          # password for FileDaemon
  File Retention = 6 months                               # six months
  Job Retention = 6 months                                # six months
  AutoPrune = yes                                         # Prune expired Jobs/Files
}

#############################################################################################
#                                       JobDef(s)
#############################################################################################

JobDefs {
  Name = "DefaultJob"
  Type = Backup
  Level = Incremental
  Client = SRV-Debian-ATB-fd
  FileSet = "Full Set"
  Schedule = "WeeklyCycle"
  Storage = BaculaFileStorage
  Messages = Standard
  Pool = BaculaPool
  SpoolAttributes = yes
  Priority = 500
  Write Bootstrap = "/var/lib/bacula/%c.bsr"
}


#############################################################################################
#                                       Job(s)
#############################################################################################

# Backup the catalog database (after the nightly save)
Job {
  Name = "BackupCatalogJob"
  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
}


# Define the main nightly save backup job
Job {
  Name = "BackupLocalFiles"
  JobDefs = "DefaultJob"
}


#############################################################################################
#                                       Storage(s)
#############################################################################################
Storage {
  Name = BaculaFileStorage
# Do not use "localhost" here
  Address = 192.168.1.6                           # N.B. Use a fully qualified name here
  SDPort = 9103
  Password = "tWYtlyJ3uw7x_YTXODfbcs9iGz-NZRU8l"
  Device = BaculaDir
  Media Type = FileBacula
  Maximum Concurrent Jobs = 10                    # run up to 10 jobs a the same time
}

#########################
#       CATALOG
#########################
Storage {
  Name = BaculaCatalogFileStorage
# Do not use "localhost" here
  Address = 192.168.1.6                           # N.B. Use a fully qualified name here
  SDPort = 9103
  Password = "tWYtlyJ3uw7x_YTXODfbcs9iGz-NZRU8l"
  Device = CatalogDir
  Media Type = FileCatalog
  Maximum Concurrent Jobs = 10                    # run up to 10 jobs a the same time
}

#############################################################################################
#                                       Pool(s)
#############################################################################################
# Default pool definition

Pool {
  Name = BaculaPool
  Pool Type = Backup
  Recycle = yes                       # Bacula can automatically recycle Volumes
  AutoPrune = yes                     # Prune expired volumes
  Volume Retention = 1 week           # one year
  #Accept Any Volume = yes 
  Recycle Current Volume = yes
  Recycle Oldest Volume = yes
  Maximum Volume Jobs = 7
  Label Format = Bacula-
  Maximum Volumes = 10               # Limit number of Volumes in Pool
}

Pool {
 Name = BaculaFullPool
 Pool Type = Backup
 Use Volume Once = yes
 Recycle = yes
 AutoPrune = yes
 Volume Retention = 2 months
 Recycle Oldest Volume = yes
 Maximum Volume Jobs = 1
 LabelFormat = "Bacula-FULL-${BaculaFullCounter+}"
}

Pool {
 Name = BaculaDiffPool
 Pool Type = Backup
 Use Volume Once = yes
 Recycle = yes
 AutoPrune = yes
 Volume Retention = 1 months
 Recycle Oldest Volume = yes
 Maximum Volume Jobs = 1
 LabelFormat = "Bacula-DIFF-${BaculaDiffCounter+}"
}

Pool {
 Name = BaculaIncrPool
 Pool Type = Backup
 Use Volume Once = yes
 Recycle = yes
 AutoPrune = yes
 Volume Retention = 1 month
 Recycle Oldest Volume = yes
 Maximum Volume Jobs = 1
 LabelFormat = "Bacula-INCR-${BaculaIncrCounter+}"
}

#########################
#       CATALOG
#########################
Pool {
 Name = BaculaCatalogFullPool
 Pool Type = Backup
 Use Volume Once = yes
 Recycle = yes
 AutoPrune = yes
 Volume Retention = 2 months
 Recycle Oldest Volume = yes
 Maximum Volume Jobs = 1
 LabelFormat = "Bacula-CATALOG-FULL-${BaculaCatalogFullCounter+}"
}

Pool {
 Name = BaculaCatalogDiffPool
 Pool Type = Backup
 Use Volume Once = yes
 Recycle = yes
 AutoPrune = yes
 Volume Retention = 1 months
 Recycle Oldest Volume = yes
 Maximum Volume Jobs = 1
 LabelFormat = "Bacula-CATALOG-DIFF-${BaculaCatalogDiffCounter+}"
}

Pool {
 Name = BaculaCatalogIncrPool
 Pool Type = Backup
 Use Volume Once = yes
 Recycle = yes
 AutoPrune = yes
 Volume Retention = 1 month
 Recycle Oldest Volume = yes
 Maximum Volume Jobs = 1
 LabelFormat = "Bacula-CATALOG-INCR-${BaculaCatalogIncrCounter+}"
}

#############################################################################################
#                                       Counter(s)
#############################################################################################

Counter {
# http://www.bacula.org/en/dev-manual/Configuring_Director.html#SECTION001419000000000000000
  Name    = BaculaFullCounter
  Minimum = 1
  #Maximum = 2
  Catalog = MyCatalog
}

Counter {
  Name    = BaculaDiffCounter
  Minimum = 1
  #Maximum = 5
 Catalog = MyCatalog
}

Counter {
  Name    = BaculaIncrCounter
  Minimum = 1
  #Maximum = 31
 Catalog = MyCatalog
}

#########################
#       CATALOG
#########################

Counter {
  Name    = BaculaCatalogFullCounter
  Minimum = 1
  #Maximum = 2
  Catalog = MyCatalog
}

Counter {
  Name    = BaculaCatalogDiffCounter
  Minimum = 1
  #Maximum = 5
  Catalog = MyCatalog
}

Counter {
  Name    = BaculaCatalogIncrCounter
  Minimum = 1
  #Maximum = 8
  Catalog = MyCatalog
}

bacula-sd.conf

#############################################################################################
#                                       Server Section
#############################################################################################
Storage {                                       # definition of myself
  Name = SRV-Debian-ATB-sd
  SDPort = 9103                                 # Director's port
  WorkingDirectory = "/var/lib/bacula"
  Pid Directory = "/run/bacula"
  Plugin Directory = "/usr/lib/bacula"
  Maximum Concurrent Jobs = 20
  SDAddress = 192.168.1.6                       # Server IP (or FQDN)
}


Director {
  Name = SRV-Debian-ATB-dir
  Password = "tWYtlyJ3uw7x_YTXODfbcs9iGz-NZRU8l"
}


Director {
  Name = SRV-Debian-ATB-mon
  Password = "e38tOmidgiUN9va0Nih-UCz1MJ_V1WFSH"
  Monitor = yes
}

#############################################################################################
#                                       Devices
#############################################################################################

#########################
#       Server Bacula
#########################

Device {
  Name = BaculaDir
  Media Type = FileBacula
  Archive Device = /mnt/bacula/backup/bacula/
  LabelMedia = yes;                   # lets Bacula label unlabeled media
  Random Access = Yes;
  AutomaticMount = yes;               # when device opened, read it
  RemovableMedia = no;
  AlwaysOpen = no;
}

Device {
  Name = CatalogDir
  Media Type = FileCatalog
  Archive Device = /mnt/bacula/backup/catalog/
  LabelMedia = yes;                   # lets Bacula label unlabeled media
  Random Access = Yes;
  AutomaticMount = yes;               # when device opened, read it
  RemovableMedia = no;
  AlwaysOpen = no;
}

Device {
  Name = DummyDir
  Media Type = FileDummy
  Archive Device = /mnt/bacula/backup/dummy/
  LabelMedia = yes;                   # lets Bacula label unlabeled media
  Random Access = yes;
  AutomaticMount = yes;               # when device opened, read it
  RemovableMedia = no;
  AlwaysOpen = no;
}

#########################
#       Client(s)
#########################


Device {
  Name = Wks1Dir
  Media Type = FileWks1
  Archive Device = /mnt/bacula/backup/Wks1/
  LabelMedia = yes;                   # lets Bacula label unlabeled media
  Random Access = Yes;
  AutomaticMount = yes;               # when device opened, read it
  RemovableMedia = no;
  AlwaysOpen = yes;
}


##############################################################################################
#                                     Send all message(s)
#############################################################################################

Messages {
  Name = Standard
  director = SRV-Debian-ATB-dir = all
}

我遗漏了什么?任何帮助都非常好!

答案1

我无意中将存储的定义与池的定义颠倒了,具体如下:

bacula-dir.conf (已损坏)

...
  Storage = DummyPool
  FileSet="Full Set"
  Pool = BaculaFileStorage
...

bacula-dir.conf (已修复)

...
  Storage = BaculaFileStorage
  FileSet="Full Set"
  Pool = DummyPool
...

相关内容