Always Incremental example?

4,674 views
Skip to first unread message

darkadept

unread,
Nov 17, 2016, 11:59:16 AM11/17/16
to bareos-users
I'm new to bareos and I'm trying to implement the "Always Incremental" backup strategy.

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
}
}

Seitan

unread,
Dec 30, 2016, 2:26:03 AM12/30/16
to bareos-users
Yes, the documentation is not informative on how to configure "Always incremental" backups. Using information from documentation leads to non-working consolidation jobs.
Full example would be really appreciated.

Hosted Power

unread,
Jan 3, 2017, 4:53:23 AM1/3/17
to bareos-users
Op vrijdag 30 december 2016 08:26:03 UTC+1 schreef Seitan:

> Yes, the documentation is not informative on how to configure "Always incremental" backups. Using information from documentation leads to non-working consolidation jobs.
> Full example would be really appreciated.

Indeed, having lots of issues with it too :|

Михаил Калинин

unread,
Jan 31, 2018, 7:13:28 AM1/31/18
to bareos-users
How prune consolidated jobs?

Dan

unread,
Jan 31, 2018, 3:50:06 PM1/31/18
to bareos-users
On Thursday, November 17, 2016 at 11:59:16 AM UTC-5, darkadept wrote:
> I'm new to bareos and I'm trying to implement the "Always Incremental" backup strategy.
>

> 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

Stefan Krüger

unread,
Feb 22, 2018, 2:16:13 AM2/22/18
to bareos-users
@Dan it would be very nice if you "pimp" a little bit you configuration with some comments to understand what happens here and why.

with that you can assist this: https://bugs.bareos.org/view.php?id=918

Dakota Pilot

unread,
May 11, 2018, 8:04:17 PM5/11/18
to bareos-users
This is fairly old but very relevant as it may be the only good documentation on how to get AI backups to actually work. One question I have is why you have autoprune off. Wouldn't you want it to prune the catalog?

Thanks for the example. I'm trying to get AI working. Creating the incrementals is easy but getting consolidate to work seems harder.

Dan

unread,
May 12, 2018, 5:45:00 PM5/12/18
to bareos-users
Dakota -

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.

Dakota Pilot

unread,
May 12, 2018, 8:01:25 PM5/12/18
to bareos-users
Ahh, I see. That makes sense.

Thomas Kimpel

unread,
Mar 2, 2019, 2:02:49 AM3/2/19
to bareos-users

@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

Giorgio Bartoccioni

unread,
Sep 15, 2023, 6:33:00 AM9/15/23
to bareos-users
Hi,
I'm revisiting this old post because I've now started using always incremental.
I followed your setup but I can't get the concurrent jobs to run.
I have FileStorageCons1 mounted and in use for the first backup of a (very large) client and FileStorageCons 2,3,4 and 5 not open.
But I also have all other clients that are waiting for incrementals. What can I check?

Bruno Friedmann (bruno-at-bareos)

unread,
Sep 20, 2023, 8:16:35 AM9/20/23
to bareos-users
Hello Giorgio, while our documentation isn't yet as perfect as it could be (PR are welcome at any times :-) it will certainly be more up to date than a 5 years old threads.
If you look for inspiration about your configuration, maybe you want to have a look at how the systemtests works 
Have a look at the test itself (testrunner) and the associated configuration will maybe create the ""Ha ! Ha !"  instant
Regards.
Reply all
Reply to author
Forward
0 new messages