0
  • volume retention period is set to 365 days
  • job retention period is set to 180 days
  • file retention period is set to 60 days

if file is unchanged on drive for 60 days, will I be able to recover it after 60 days?
if file is deleted from backup after 60 days, what options do I have other than increase file retention period?
(ex. can I do a full/differential/incremental backup while still in the 60 days period?)


other use case:

  • volume retention period is set to 30 days
  • job retention period is set to 180 days
  • file retention period is set to 60 days

does this setup work? or after the 30 days since creation of volume the volume is destroyed together with contained jobs and files?
what options do I have to preserve the file?

gekigek99
  • 103
  • 4
  • 1
    https://www.bacula.org/13.0.x-manuals/en/main/Configuring_Director.html#blb:FileRetention - *"File records may actually be retained for a shorter period than you specify on this directive if you specify either a shorter Job Retention or a shorter Volume Retention period. **The shortest retention period of the three takes precedence**."* – HBruijn Aug 22 '22 at 15:33

1 Answers1

1

It is not file is getting deleted after the retention period, but a catalog record about that file. When that record is deleted, you are still able to recover the file. But, you won't be able to find it or select files to extract from jobs whose files were expired. All you might be able to do is to recover the whole job, optionally you can filter which files to extract with regexp. When the job catalog records expire too, you may still extract data from the (raw) volume.

Also an option is this case is to extract old catalog backup, recover it to some VM and use that to recover files from old jobs.

Only the "volume purge" operation irreversibly destroys old backup data. You have set retention period for a year, which means, if you really be able to keep all those volumes that long, you'll be able to recover any files up to a year ago. This also means, while it is possible to set volume retention period shorter than others, this configuration is useless — your files and jobs retention period will be effectively cut to volume retention. When Bacula/BareOS is going to purge a volume, it first removes all jobs which used that volume and consequently all files which belong to that jobs.

File records take by far the most space in the Bacula/BareOS catalog database. This is the motivation to expire file records early — to keep the database from inflating.


All of this doesn't correlate much with how often the file is updated. You should you have regular full backups (by default, once per month). It serves as the "base" for subsequent differential and incremental backups; unchanged files don't get into those relative backups. But full backup always contains all files, even those which are unchanged since some previous backup. For instance, if you backup some fileset which doesn't change at all, you will have all full backups of the same size and zero-sized differential and incremental backups.

Also notice, by default change of fileset triggers a full backup.

Nikita Kipriyanov
  • 8,033
  • 1
  • 21
  • 39
  • thanks a lot for the explanation! what if file retention is 60 days but i only do a full backup every 90 days? (incremental backup everyday) – gekigek99 Aug 22 '22 at 16:00
  • and what if file retention is 60 days but i only do a full backup once a year? (incremental every 90 days) – gekigek99 Aug 22 '22 at 16:02
  • 1
    No. Do full backups every month. In that case if you want to guarantee restore up to N months back, you need N+1 full backup plus corresponding differential and incremental (I don't want to dive deep into arithmetic here, just draw a timeline and you'll see). And please read explanations again, file retention does not specify for how long the file data is retained; it is for how long a database catalog database record is retained. Only volume retention really matters here. File retention of 60 (= two full backup periods) looks fine for me. – Nikita Kipriyanov Aug 22 '22 at 16:25
  • I know, it takes time to master a timeline of Bacula backups. However, if you are going to manage and maintain Bacula, you'll need to master this skill, there is no way around. Or have someone who calculates everything for you. – Nikita Kipriyanov Aug 22 '22 at 16:27
  • to make it simple then I could set volume/job/file retention to 90 days (with full backup every month, differentiale every week and incremental every day) and call it a day? (so that once file is not in database anymore also the data is purged) – gekigek99 Aug 22 '22 at 16:40
  • 1
    yes, it would work like that – Nikita Kipriyanov Aug 22 '22 at 16:54