I have about 250gb of data I'm backing up onto a NAS (mounted via CIFS).
I can't find any other documentation or examples about Always Incremental except for what it mentions in the docs. I think I have configured it as to what it says but I'm not sure. Does this look correct?
My assumption is that this configuration will:
* Do a full backup initially
* Do incremental backups every weekday at 21:00
* Consolidate (every weekday) the incrementals older than 7 days
* Always keep at least 7 incrementals
* Consolidate job only consolidates with the Full backup every 14 days, otherwise it consolidates just the incrementals (not sure if this is the correct assumption of how "Always Incremental Max Full Age" works.)
* Only consolidates 1 per consolidate job (if multiple clients).
* Creates a virtual full backup on the 1st saturday of every month.
-------------------------------------------------
On my Storage Daemon I have two devices configured:
Device {
Name = AI-Consolidated
Media Type = File
Archive Device = /mnt/nas/bareos/consolidated
LabelMedia = yes;
Random Access = yes;
AutomaticMount = yes;
RemovableMedia = no;
AlwaysOpen = no;
Description = "Used for AI consolidated backups"
}
Device {
Name = AI-File
Media Type = File
Archive Device = /mnt/nas/bareos/file
LabelMedia = yes;
Random Access = yes;
AutomaticMount = yes;
RemovableMedia = no;
AlwaysOpen = no;
Description = "Used for AI regular"
}
-------------------------------------------------
On my Director I have the following three pools:
Pool {
Name = AI-Incremental
Pool Type = Backup
Recycle = yes
AutoPrune = no
Maximum Volume Bytes = 50G
Label Format = "AI-Incremental-"
Volume Use Duration = 23h
Storage = MyStorage-AI-File
}
Pool {
Name = AI-Consolidated
Pool Type = Backup
Recycle = yes
AutoPrune = no
Maximum Volume Bytes = 50G
Label Format = "AI-Consolidated-"
Volume Use Duration = 23h
Storage = Steinbach-AI-Consolidated
Next Pool = AI-Longterm
}
Pool {
Name = AI-Longterm
Pool Type = Backup
Recycle = yes
AutoPrune = yes
Volume Retention = 10 years
Maximum Volume Bytes = 50G
Label Format = "AI-Longterm-"
Volume Use Duration = 23h
Storage = MyStorage-AI-File
}
-------------------------------------------------
I also have the following two Schedules defined:
Schedule {
Name = AI-Cycle
Run = Incremental mon-fri at 21:00
}
Schedule {
Name = AI-Longterm
Run = Full 1st sat at 21:00
}
-------------------------------------------------
And finally I have the following three Jobs defined:
Job {
Name = Backup-data
Client = myclient
FileSet = MyFileSetData
Always Incremental = yes
Always Incremental Job Retention = 7 days # older than this will be merged into new Virtual backup
Always Incremental Keep Number = 7 # will always keep this many incrementals
Always Incremental Max Full Age = 14 days
Accurate = yes
Pool = AI-Incremental
Full Backup Pool = AI-Consolidated
Type = Backup
Level = Incremental
Schedule = AI-Cycle
Messages = Standard
Priority = 10
Write Bootstrap = "/var/lib/bareos/%c.bsr"
}
Job {
Name = Consolidate-data
Type = Consolidate
Accurate = yes
JobDefs = DefaultJob
Max Full Consolidations = 1
}
Job {
Name = VirtualLongtermFull
Client = bareos-fd
FileSet = SelfTest
Schedule = AI-Longterm
Type = Backup
Level = VirtualFull
Pool = AI-Consolidated
Messages = Standard
Priority = 13
Run Script {
console = "update jobid=%i jobtype=A"
Runs When = After
Runs On Client = No
Runs On Failure = No
}
}
Indeed, having lots of issues with it too :|
> My assumption is that this configuration will:
> * Do a full backup initially
> * Do incremental backups every weekday at 21:00
> * Consolidate (every weekday) the incrementals older than 7 days
> * Always keep at least 7 incrementals
> * Consolidate job only consolidates with the Full backup every 14 days, otherwise it consolidates just the incrementals (not sure if this is the correct assumption of how "Always Incremental Max Full Age" works.)
> * Only consolidates 1 per consolidate job (if multiple clients).
> * Creates a virtual full backup on the 1st saturday of every month.
----------------------------------
You are mostly correct in your configuration. The documentation almost gets you to a working AI implementation, but there are a few gotchas that have to be worked through. It's hard keep my answer clear by marking up each of your conf files, so I'll post you a configuration that I've had in production for a while as complete working example. I'll use the notations BOF and EOF for beginning of file and end of file, respectively. Lines containing those notations should not be included in you conf files.
This is a LONG POST. Bear with me.
The below configuration will ...
* Do incremental backups 20:00 every day. By definition the 1st will be a full backup.
* Consolidate at 21:00 every 4th day starting on the 3rd day of the month.
* Only consolidate incrementals older than 7 days
* Keep at least 7 incrementals
* Consolidate with the Full backup every 14 days. (I don't consolidate very day, so my full gets picked up on the first consolidate job on or after 14 days.
* Only consolidates 1 per consolidate job (if multiple clients).
* Creates a virtual full backup at noon on the 1st day of the month.
-------------------------------------------------
On my Storage Daemon I have the following:
STORAGE:
BOF - storage/bareos-sd.conf
Storage {
Name = bareos-sd
Maximum Concurrent Jobs = 5
Device Reserve By Media Type = yes # This entry is REQUIRED for successful consolidation. See FileStorageCons.conf.
}
EOF
DEVICES:
BOF - device/FileStorage.conf
Device {
Name = FileStorage
Media Type = File
Archive Device = /bareosFiles/BareosBackups/storage
LabelMedia = yes
Random Access = yes
AutomaticMount = yes
RemovableMedia = no
AlwaysOpen = no
Description = "File device of for general use."
Maximum Concurrent Jobs = 5
}
EOF
BOF - device/FileStorageCons.conf
Device {
Name = FileStorageCons1 # Multiple devices, different name and same media type, are configured to support simultaneous use.
Media Type = FileCons
Archive Device = /bareosFiles/BareosBackups/storage
LabelMedia = yes
Random Access = yes
AutomaticMount = yes
RemovableMedia = no
AlwaysOpen = no
}
Device {
Name = FileStorageCons2
Media Type = FileCons
Archive Device = /bareosFiles/BareosBackups/storage
LabelMedia = yes
Random Access = yes
AutomaticMount = yes
RemovableMedia = no
AlwaysOpen = no
}
Device {
Name = FileStorageCons3
Media Type = FileCons
Archive Device = /bareosFiles/BareosBackups/storage
LabelMedia = yes
Random Access = yes
AutomaticMount = yes
RemovableMedia = no
AlwaysOpen = no
}
Device {
Name = FileStorageCons4
Media Type = FileCons
Archive Device = /bareosFiles/BareosBackups/storage
LabelMedia = yes
Random Access = yes
AutomaticMount = yes
RemovableMedia = no
AlwaysOpen = no
}
Device {
Name = FileStorageCons5
Media Type = FileCons
Archive Device = /bareosFiles/BareosBackups/storage
LabelMedia = yes
Random Access = yes
AutomaticMount = yes
RemovableMedia = no
AlwaysOpen = no
}
EOF
BOF - FileStorageVLT.conf
Device {
Name = FileStorageVLT
Media Type = FileVLT
Archive Device = /bareosFiles/BareosBackups/storage
LabelMedia = yes
Random Access = yes
AutomaticMount = yes
RemovableMedia = no
AlwaysOpen = no
Description = "File device for VLT backups."
Maximum Concurrent Jobs = 5
}
EOF
-------------------------------------------------
On my Director I have the following ...
STORAGE:
BOF - storage/File.conf
Storage {
Name = File
Address = <storage daemon hostname>
Password = "<storage daemon password>"
Device = FileStorage
Media Type = File
}
EOF
BOF - storage/FileCons.conf
Storage {
Name = FileCons
Address = <storage daemon hostname>
Password = "<storage daemon password>"
Device = FileStorageCons1 # Note that these correspond to the SD device/FileStorageCons.conf devices.
Device = FileStorageCons2
Device = FileStorageCons3
Device = FileStorageCons4
Device = FileStorageCons5
Media Type = FileCons
Maximum Concurrent Jobs = 5
}
EOF
BOF - storage/FileVLT.conf
Storage {
Name = FileVLT
Address = <storage daemon hostname>
Password = "<storage daemon password>"
Device = FileStorageVLT
Media Type = FileVLT
}
EOF
POOLS:
BOF - pool/AI-Incremental.con
Pool {
Name = AI-Incremental
Pool Type = Backup
Recycle = yes
Auto Prune = no
Maximum Volume Bytes = 5G
Label Format = "AI-Incremental-"
Volume Use Duration = 7 days
Storage = File
Next Pool = AI-Consolidated
Volume Retention = 1 years
Maximum Volumes = 15
}
EOF
BOF - pool/AI-Consolidated.conf
Pool {
Name = AI-Consolidated
Pool Type = Backup
Recycle = yes
Auto Prune = no
Maximum Volume Bytes = 5G
Label Format = "AI-Consolidated-"
Volume Use Duration = 18 hours
Storage = FileCons
Next Pool = AI-LongTerm
Volume Retention = 1 years
Maximum Volumes = 75
}
EOF
BOF - pool/AI-LongTerm.conf
Pool {
Name = AI-LongTerm
Pool Type = Backup
Recycle = yes
Auto Prune = yes
Maximum Volume Bytes = 10G
Label Format = "AI-LongTerm-"
Volume Use Duration = 2 days
Storage = FileVLT
Volume Retention = 180 days
Maximum Volumes = 100
}
EOF
SCHEDULES:
BOF - AISched.conf
Schedule {
Name = "AISched"
Run = Incremental sun-sat at 20:00 # (#10)
}
EOF
BOF - ConsolidateSched.conf
Schedule {
Name = "ConsolidateSched"
Run = Incremental 3/4 at 21:00
}
EOF
BOF - LongTemrSched.conf
Schedule {
Name = "LongTermSched"
Run = on 1 at 12:00
}
EOF
JOBS
BOF - job/myhost-ai.conf
Job {
Name = "myhost-ai"
Client = "myhost-fd"
FileSet = LinuxAll
Type = Backup
Level = Incremental
Schedule = "AISched"
Storage = File
Messages = Standard
Pool = AI-Incremental
Priority = 15
Write Bootstrap = "/bareosFiles/BareosCopiesProd/bootstraps/%c.bsr"
Full Backup Pool = AI-Consolidated
Incremental Backup Pool = AI-Incremental
Accurate = yes
Allow Mixed Priority = yes
Always Incremental = yes
Always Incremental Job Retention = 7 days
Always Incremental Keep Number = 7
Always Incremental Max Full Age = 21 days
}
EOF
BOF - job/Consolidate.conf
Job {
Name = Consolidate
Type = Consolidate
Client = myhost-fd
FileSet = LinuxAll
Accurate = yes
Schedule = "ConsolidateSched"
Storage = File
Messages = Standard
Pool = AI-Consolidated
Priority = 25
Write Bootstrap = "/bareosFiles/BareosCopiesProd/bootstraps/%c.bsr"
Full Backup Pool = AI-Consolidated
Incremental Backup Pool = AI-Incremental
Max Full Consolidations = 1
Prune Volumes = yes
}
EOF
BOF - job/myhost-vlt.conf
Job {
Name = "myhost-vlt"
Client = myhost-fd
FileSet = LinuxAll
Schedule = LongTermSched
Type = Backup
Level = VirtualFull
Pool = AI-Consolidated
Messages = Standard
Priority = 30
Accurate = yes
Run Script {
console = "update jobid=%i jobtype=A"
Runs When = After
Runs On Client = No
Runs On Failure = No
}
}
EOF
with that you can assist this: https://bugs.bareos.org/view.php?id=918
Thanks for the example. I'm trying to get AI working. Creating the incrementals is easy but getting consolidate to work seems harder.
The reason that you don't want to set your pools to autoprune is that if you are configured properly and your system is running properly autoprune will never happen. Your consolidation will always happen before the backup exceeds the retention time. So if there is a problem you will be made aware of it without losing your data, at very least when your storage fills up. If the consolidations stopped running and your volume expired and autoprune deleted your backup data you would be in a bad place.
@Dan I have taken your config to my server, daily incremenatals now working, the 4 day consolidate is working, but my monthly virtual full is failing. job started, and after a few minutes the director is hanging, and no reaction in bconsole or the webui