我有一个关于在硬盘上使用 bacula 实现 GFS 方案的问题(守护进程已经运行良好)。
我想要实现的目标:
每半年我想要一个完整备份,该备份至少应可访问 12 个月 -> 我需要将备份保留比 12 个月稍长的时间,以便第二次完整备份不会覆盖第一次备份。这意味着将至少有 3 个完整备份(我选择了 18 个月)。它会持续几天、几个月等等。简单的 GFS 方案。
Schedule{
Name = "GGFSCycle"
Enabled = yes
# DailyCycle - the volume is kept for 14 days
Run = Level=Incremental Pool=DailyPool FullPool=HalfAnnualPool Priority=10 tuesday-sunday at 03:00
# WeeklyCycle - the volume is kept for 5 weeks
Run = Level=Incremental Pool=WeeklyPool FullPool=HalfAnnualPool Priority=11 monday at 03:00
# MonthlyCycle - the volume is kept for 7 months
Run = Level=Differential Pool=MonthlyPool FullPool=HalfAnnualPool Priority=12 february-june 1 at 03:00
Run = Level=Differential Pool=MonthlyPool FullPool=HalfAnnualPool Priority=12 august-december 1 at 03:00
# HalfAnnualCycle - the data is kept for 18 months
Run = Level=Full Pool=HalfAnnualPool Priority=13 january 1 at 03:00
Run = Level=Full Pool=HalfAnnualPool Priority=13 july 1 at 03:00
}
Pool {
Name = DailyPool
Pool Type = Backup
Storage = backup-server-sd
Label Format = "DailyVol_"
Volume Use Duration = 23 hours
Recycle = yes # Bacula can automatically recycle Volumes
AutoPrune = yes # Prune expired volumes
Volume Retention = 14 days
Maximum Volume Bytes = 50M # Limit Volume size to something reasonable
Maximum Volumes = 1000 # Limit number of Volumes in Pool
# -> max 50G
}
Pool {
Name = WeeklyPool
Pool Type = Backup
Storage = backup-server-sd
Label Format = "WeeklyVol_"
Volume Use Duration = 23 hours
Recycle = yes
AutoPrune = yes
Volume Retention = 5 weeks
Maximum Volume Bytes = 500M
Maximum Volumes = 80
# -> max 70G
}
Pool {
Name = MonthlyPool
Pool Type = Backup
Storage = backup-server-sd
Label Format = "MonthlyVol_"
Volume Use Duration = 2 days
Recycle = yes
AutoPrune = yes
Volume Retention = 7 months
Maximum Volume Bytes = 5G
Maximum Volumes = 80
# -> max 170G
}
Pool {
Name = HalfAnnualPool
Pool Type = Backup
Label Format = "HalfannualVol_"
Storage = backup-server-sd
Volume Use Duration = 3 days
Recycle = yes
AutoPrune = yes
Volume Retention = 18 months #1,5 years
Maximum Volume Bytes = 35G
Maximum Volumes = 20
# -> max 700G
}
我看到的问题:
增量备份总是引用上次的增量、差异或完整备份,并且只保存自那时以来发生变化的文件。在我的方案中,我有两个“不同的”增量备份,即每日备份和每周备份。每周备份总是引用前一天的每日备份,对吗?当我将每周备份保留超过 4 周(我选择了 5 周)并且将每日备份保留超过 10 天(我选择了 14 天)时,每日文件将在 14 天后被删除,但每月备份仍会引用它们。那么会有一个“漏洞”吗?
我发现,如果可以有多个“级别”的增量备份,比如我可以说每周增量备份仅引用每周备份(级别 0),每日增量备份仅引用每日备份(级别 1),那么问题就解决了。当我将完整备份保留太短时间时,也会出现同样的问题。例如,如果完整备份覆盖了唯一现有的备份,那么差异备份将不再有完整备份可以引用,并且我会丢失到那时为止所做的所有备份。
我的发现:
我在网上搜索了一下,找到了一个bacula-documentation 中的章节:它指出:“现在,由于每种不同类型的保存都需要在不同的时间段内保持有效,因此最简单的方法(也可能是唯一的方法)是为每种备份类型设置一个单独的池。”。
我的问题:
- 这基本上意味着除了 bacula 文档章节中的单个 full-、diff- 和 inkr-pools 之外没有其他解决方案。这是正确的吗?
- 如果不正确,我如何使用两个不同的增量池来实现我的目标?
我也在 bacula 文档中阅读了有关基本作业的内容,虽然这不是正确的事情,但它朝着正确的方向发展。
非常感谢您花时间并帮助阅读到这里。
附言:我的母语不是英语,如果我确实犯了错误,我很抱歉。如果有什么事情真的让你恼火,我愿意听听你的意见,以提高我的英语水平。
谢谢。
答案1
到目前为止,我已经在 bacula-user-mailinglist 的帮助下解决了这个问题。对于单个作业,不可能有效地拥有多个增量池。我已将设置更改为:
Schedule{
Name = "GFSCycle"
Enabled = yes
# DailyCycle - the volumes are kept for 40days
Run = Level=Incremental Pool=DailyPool FullPool=HalfAnnualPool Priority=10 daily at 03:00
# MonthlyCycle - the volumes are kept for 7months
Run = Level=Differential Pool=MonthlyPool FullPool=HalfAnnualPool Priority=11 february-june 1 at 03:00
Run = Level=Differential Pool=MonthlyPool FullPool=HalfAnnualPool Priority=11 august-december 1 at 03:00
# HalfAnnualCycle - the volumes are kept 12months
Run = Level=Full Pool=HalfAnnualPool Priority=12 january 1 at 03:00
Run = Level=Full Pool=HalfAnnualPool Priority=12 july 1 at 03:00
Pool {
Name = DailyPool
Pool Type = Backup
Storage = backup-server-sd
Label Format = "DailyVol_"
Volume Use Duration = 23 hours
Recycle = yes # Bacula can automatically recycle Volumes
AutoPrune = yes # Prune expired volumes
Volume Retention = 40 days
Maximum Volume Bytes = 50M # Limit Volume size to something reasonable
Maximum Volumes = 3000 # Limit number of Volumes in Pool
# -> max 150G
}
Pool {
Name = MonthlyPool
Pool Type = Backup
Storage = backup-server-sd
Label Format = "MonthlyVol_"
Volume Use Duration = 2 days
Recycle = yes
AutoPrune = yes
Volume Retention = 7 months
Maximum Volume Bytes = 5G
Maximum Volumes = 80
# -> max 170G
}
Pool {
Name = HalfAnnualPool
Pool Type = Backup
Label Format = "HalfannualVol_"
Storage = backup-server-sd
Volume Use Duration = 3 days
Recycle = yes
AutoPrune = yes
Volume Retention = 12 months
Maximum Volume Bytes = 35G
Maximum Volumes = 20
# -> max 700G
}
该单个客户端的文件和作业保留被设置为最大卷保留。
-> 文件保留 = 12 个月,工作保留 = 12 个月
还有可能派上用场的虚拟完整备份,详细说明如下: https://www.baculasystems.com/incremental-backup-software/
再次感谢 bacula-user-mailinglist 上帮助我解决这个问题的每个人。