“仅附加”文件属性触发文件的增量备份

“仅附加”文件属性触发文件的增量备份

使用此命令设置的“仅附加”属性chattr -R +a /mnt/A会导致 bacula 不断增量备份文件,即使这些文件没有更改。我能够通过将文件+文件夹属性的数量+a与备份文件的数量进行比较来确定这一点。

这是文件集

# file set of archivio
FileSet {
  Name = "archivio set"
  Include {
    Options {
      signature=MD5
      # compression=GZIP    # slows down a lot (from 120MB/s to 30MB/s)
      verify = pins5
      onefs = yes
    }
    File = "/mnt/A/"
  }
  Exclude {
    # exclude .cestino directory since deleted files are already backed up in previous bacula jobs
    # don't know why but /* is required, otherwise the files in this directory are not excluded
    File = "/mnt/A/.cestino/*"
  }
}

这是工作

# Backup archivio
Job {
  Name = "archivio backup"
  Schedule = "schedule archivio"
  # set to 31 days so that if the monthly full archivio backup is missed because of offline server
  # it will be rerun as soon as possible
  Max Full Interval = 31 days
  # set to 8 days so that if the weekly diff archivio backup is missed because of offline server
  # it will be rerun as soon as possible
  Max Diff Interval = 8 days
  Enabled = yes
  Priority = 10
  Type = Backup
  Level = Full
  Client = servbros-client
  Storage = servbros-storage
  FileSet = "archivio set"
  Pool = archivio-pool-diff
  Full Backup Pool = archivio-pool-full     # specifies a Pool to be used for Full backups
  Incremental Backup Pool = archivio-pool-incr  # specifies a Pool to be used for Differential backups
  Differential Backup Pool = archivio-pool-diff # specifies a Pool to be used for Incremental backups
  Accurate = yes
  Reschedule Interval = 1h
  Reschedule On Error = yes
  Reschedule Incomplete Jobs = yes
  Reschedule Times = 3
  # notify start of job
  RunBeforeJob = "python3.8 /mnt/A/commands/notify.py -l '<b>Bacula</b>' 'starting: %n' 'job id: %i' 'job type: %t - %l'"
  # create ASCII copy of catalog and store it
  RunAfterJob = "/etc/bacula/scripts/make_catalog_backup.pl servbros-catalog"
  RunAfterJob = "mv /var/lib/bacula/bacula.sql /mnt/B/bacula-database/%c-%j-job%i.sql"
  RunAfterJob = "chmod 644 /mnt/B/bacula-database/%c-%j-job%i.sql"
  # don't use variable strings as data is appended to file when !Full backup
  Write Bootstrap = "/mnt/B/bacula-bootstrap/%c-%n.bsr"
  Messages = telegram
}
  1. 为什么会有这样的行为?
  2. 我该怎么做才能保留此属性并且仍拥有可正常运行的 bacula 备份?
  3. 是否可以通过 baculum/bconsole 知道为什么选择备份某个文件?(因为我花了一个半小时试图找出备份这些文件的原因)

答案1

问题是由 crontab 更改需要备份的文件夹的 c_time 引起的。

通过添加已修复问题accurate = pinsm,以便 c_time 不再被视为备份文件的因素。(该作业必须在准确模式下运行)

# file set of archivio
FileSet {
  Name = "archivio set"
  Include {
    Options {
      signature=MD5
      # compression=GZIP    # slows down a lot (from 120MB/s to 30MB/s)
      verify = pins5
      accurate = pinsm
      onefs = yes
    }
    File = "/mnt/A/"
  }
  Exclude {
    # exclude .cestino directory since deleted files are already backed up in previous bacula jobs
    # don't know why but /* is required, otherwise the files in this directory are not excluded
    File = "/mnt/A/.cestino/*"
  }
}

相关内容