FileSet resource

A FileSet resource says what a backup job saves: the Include blocks list files and plugins with Options blocks for compression, signatures and patterns; Exclude blocks leave things out.

Examples

Linux system with excludes

FileSet {
  Name = LinuxAll
  Include {
    Options {
      Signature = XXH128
      Compression = LZ4
      One FS = no
      FS Type = ext4, xfs, btrfs
    }
    Options {
      Wild Dir = "*/.cache"
      Wild File = "*.tmp"
      Exclude = yes
    }
    File = /
    Exclude Dir Containing = .nobackup
  }
  Exclude {
    File = /var/lib/bareos
    File = /proc
    File = /tmp
  }
}

The first Options block whose patterns match decides: .cache directories and *.tmp files are excluded, everything else on ext4, xfs and btrfs file systems is saved with checksum and compression.

A database through a plugin

FileSet {
  Name = PostgreSQL
  Include {
    Options {
      Signature = XXH128
    }
    Plugin = "python3:module_name=bareos-fd-postgresql"
  }
}

Directives

DirectiveTypeDefaultSummary
NamenamerequiredName of the FileSet.
DescriptionstringFree text describing the FileSet.
IncludeblockBlock with the files to back up (File, Plugin) and Options blocks that say how.
ExcludeblockBlock with files and directories to leave out (File lines).
Ignore File Set Changesyes|nonoNormally a change of the FileSet makes the next Incremental or Differential a Full, since the old backups do not contain the new files.
Enable VSSyes|noyesOn Windows clients: back up from a Volume Shadow Copy snapshot, so open files are consistent.

Name

Key: name · Type: name · Required

Name of the FileSet.

FileSet {
  Name = "LinuxAll"
}

In the console:

configure add fileset name=LinuxAll

Description

Key: description · Type: string

Free text describing the FileSet.

FileSet {
  Name = LinuxAll
  Description = "All local file systems"
}

In the console:

configure update fileset=LinuxAll description="All local file systems"

Include

Key: include · Type: block

Block with the files to back up (File, Plugin) and Options blocks that say how. A FileSet may have several Include blocks. See the Include block.

FileSet {
  Name = LinuxAll
  Include {
    Options {
      Signature = XXH128
    }
    File = /etc
    File = /home
  }
}

Exclude

Key: exclude · Type: block

Block with files and directories to leave out (File lines). Patterns go into an Options block with Exclude = yes instead.

FileSet {
  Name = LinuxAll
  Exclude {
    File = /home/*/.cache
    File = /tmp
  }
}

Ignore File Set Changes

Key: ignorefilesetchanges · Type: yes|no · Default: no · Values: yes, no

Normally a change of the FileSet makes the next Incremental or Differential a Full, since the old backups do not contain the new files. With yes the change is ignored; new files then only appear in the next Full.

FileSet {
  Name = LinuxAll
  Ignore File Set Changes = yes
}

In the console:

configure update fileset=LinuxAll ignorefilesetchanges=yes

Enable VSS

Key: enablevss · Type: yes|no · Default: yes · Values: yes, no

On Windows clients: back up from a Volume Shadow Copy snapshot, so open files are consistent.

FileSet {
  Name = LinuxAll
  Enable VSS = yes
}

In the console:

configure update fileset=LinuxAll enablevss=yes

Include block

Files and plugins to back up, with Options blocks.

DirectiveTypeDefaultSummary
FilepathA file or directory to back up; directories are backed up recursively.
PluginstringA File Daemon plugin with its options that delivers the data instead of files, for example a database plugin.
Exclude Dir ContainingstringLeave out every directory that contains a file of this name, so users can mark directories with a .nobackup file.
OptionsblockBlock of options for the files of this Include.

File

Key: file · Type: path

A file or directory to back up; directories are backed up recursively. Repeat it for several paths. “|command” uses the output of a command on the Director as list, “\\|command” one run on the client, and “<file” ("\\<file" on the client) reads the list from a file.

File = /home

Plugin

Key: plugin · Type: string

A File Daemon plugin with its options that delivers the data instead of files, for example a database plugin. The Onesimus Director masks secrets in plugin lines in show output and in the FileSet text stored in the catalog; the File Daemon still gets the real line.

Plugin = "python3:module_name=bareos-fd-postgresql:db_host=localhost"

Exclude Dir Containing

Key: excludedircontaining · Type: string

Leave out every directory that contains a file of this name, so users can mark directories with a .nobackup file.

Exclude Dir Containing = .nobackup

Options

Key: options · Type: block

Block of options for the files of this Include. Several Options blocks may be given: the first block whose patterns match a file decides; a block without patterns applies to all remaining files. See the Options block.

Options {
  Signature = XXH128
  Compression = LZ4
}

Exclude block

Files and directories to leave out.

DirectiveTypeDefaultSummary
FilepathA file or directory that is left out.

File

Key: file · Type: path

A file or directory that is left out. Wildcards are not interpreted here; use an Options block with Wild and Exclude = yes for patterns.

File = /var/tmp

Options block

Options of an Include block. Several blocks may be given; the first block whose patterns (Wild, Regex, …) match a file decides, a block without patterns applies to all other files. The option keywords and values follow the Onesimus Director’s port of the C++ table (inc_conf.cc); Hard Links defaults to no, Acl Support and Xattr Support to yes.

DirectiveTypeDefaultSummary
SignatureenumChecksum stored for every file, used by verify jobs and Accurate mode to detect changes.
CompressionenumSoftware compression on the client.
EncryptionenumCipher for data encryption on the client.
Force Encryptionyes|nonoFail the job instead of backing up unencrypted when encryption is not possible.
One FSyes|noyesStay on the file system of each File line and do not descend into other mounted file systems.
Recurseyes|noyesBack up directories recursively.
Sparseyes|nonoStore sparse files efficiently (holes are not stored), for example virtual machine images.
Hard Linksyes|nonoDetect hard links and store the data of a multiply linked file once.
ReplaceenumalwaysDefault replace mode for restores of these files.
Read Fifoyes|nonoRead the data from named pipes (FIFOs) instead of saving them as special files, for example to back up a database dump written into a pipe by a Client Run Before Job script.
Portableyes|nonoOn Windows: store files in a portable format (without Windows backup streams), so they can be restored on other systems, at the cost of security information.
Mtime Onlyyes|nonoSelect files for Incremental and Differential backups by modification time only, ignoring the change time (ctime).
Keep Atimeyes|nonoReset the access time of each file after reading it.
Noatimeyes|nonoOpen files with O_NOATIME so reading does not change the access time (Linux, file owner or root).
Excludeyes|nonoThe files matched by the patterns of this Options block are excluded instead of included.
Acl Supportyes|noyesBack up POSIX and NFSv4 ACLs.
Xattr Supportyes|noyesBack up extended attributes (for example SELinux labels).
Ignore Caseyes|nonoMatch Wild and Regex patterns without regard to case; useful for Windows clients.
Hfs Plus Supportyes|nonoOn macOS: back up HFS+ resource forks and Finder information.
Enhanced Wildyes|nonoAccepted for compatibility; the Director stores it like Noatime (the C++ Director does the same).
Check File Changesyes|nonoCheck after reading a file whether it changed while it was saved, and warn if so.
Honor No Dump Flagyes|nonoSkip files that carry the nodump flag (chattr +d).
ShadowingenumnoneDetects File lines that lie inside other File lines (and would be saved twice): warn about them or remove them, within this Include (local) or the whole FileSet (global).
Auto Excludeyes|noyesOn Windows: honour the files the system lists as not to be backed up (FilesNotToBackup).
VerifystringAttributes compared by verify jobs, as option letters: i inode, p permissions, n links, u user, g group, s size, a atime, m mtime, c ctime, d size decrease, 5 MD5, 1 SHA1.
AccuratestringAttributes compared in Accurate mode to decide whether a file changed, as option letters like Verify (default mcs: mtime, ctime and size).
Strip Pathpositive integerRemoves this many leading path components before the files are stored.
SizestringSelect files by size: a size, a range (10k-1m) or a comparison (<1m, >1g).
WildpatternShell wildcard (* ? [ ]) matched against the full path; repeatable.
Wild DirpatternWildcard matched against directory paths only.
Wild FilepatternWildcard matched against file names (not directories); a pattern without / matches the base name.
RegexpatternPOSIX extended regular expression matched against the full path; repeatable.
Regex DirpatternRegular expression matched against directory paths only.
Regex FilepatternRegular expression matched against file paths only.
FS Typestring listOnly back up file systems of these types (ext4, xfs, btrfs, …).
Drive Typestring listOn Windows: only back up drives of these types (fixed, removable, remote, cdrom, ramdisk).
Metastring listMeta information passed to plugins.
PluginstringPlugin that handles the files of this Options block.

Signature

Key: signature · Type: enum · Values: MD5, SHA1, SHA256, SHA512, XXH128

Checksum stored for every file, used by verify jobs and Accurate mode to detect changes. XXH128 is fast; SHA256 or SHA512 are cryptographic. Without it no checksum is stored.

Signature = XXH128

Compression

Key: compression · Type: enum · Values: GZIP, GZIP1, GZIP2, GZIP3, GZIP4, GZIP5, GZIP6, GZIP7, GZIP8, GZIP9, LZO, LZFAST, LZ4, LZ4HC

Software compression on the client. LZ4 is fast with moderate gain, GZIP6 (= GZIP) compresses better but costs CPU. Leave it off for data that is compressed already and for tape drives that compress in hardware (see Allow Compression of the Storage).

Compression = LZ4

Encryption

Key: encryption · Type: enum · Values: blowfish, 3des, aes128, aes192, aes256, camellia128, camellia192, camellia256, aes128hmacsha1, aes256hmacsha1

Cipher for data encryption on the client. Encryption also needs PKI keys in the File Daemon’s configuration; without the private key the data cannot be restored.

Encryption = aes256

Force Encryption

Key: forceencryption · Type: yes|no · Default: no · Values: yes, no

Fail the job instead of backing up unencrypted when encryption is not possible.

Force Encryption = yes

One FS

Key: onefs · Type: yes|no · Default: yes · Values: yes, no

Stay on the file system of each File line and do not descend into other mounted file systems. With no, mount points are crossed; then FS Type helps to skip /proc, /sys and network file systems.

One FS = no

Recurse

Key: recurse · Type: yes|no · Default: yes · Values: yes, no

Back up directories recursively. With no, only the entries directly in a listed directory are saved.

Recurse = no

Sparse

Key: sparse · Type: yes|no · Default: no · Values: yes, no

Store sparse files efficiently (holes are not stored), for example virtual machine images.

Sparse = yes

Key: hardlinks · Type: yes|no · Default: no · Values: yes, no

Detect hard links and store the data of a multiply linked file once. In Bareos 25 the default is no (each link is saved as a file), which saves memory on clients with many files; the Onesimus Director has the same default.

Hard Links = yes

Replace

Key: replace · Type: enum · Default: always · Values: always, ifnewer, never

Default replace mode for restores of these files.

Replace = ifnewer

Read Fifo

Key: readfifo · Type: yes|no · Default: no · Values: yes, no

Read the data from named pipes (FIFOs) instead of saving them as special files, for example to back up a database dump written into a pipe by a Client Run Before Job script.

Read Fifo = yes

Portable

Key: portable · Type: yes|no · Default: no · Values: yes, no

On Windows: store files in a portable format (without Windows backup streams), so they can be restored on other systems, at the cost of security information.

Portable = yes

Mtime Only

Key: mtimeonly · Type: yes|no · Default: no · Values: yes, no

Select files for Incremental and Differential backups by modification time only, ignoring the change time (ctime).

Mtime Only = yes

Keep Atime

Key: keepatime · Type: yes|no · Default: no · Values: yes, no

Reset the access time of each file after reading it. This changes the ctime, so Incrementals would save the files again unless Mtime Only is set; Noatime is usually the better choice.

Keep Atime = yes

Noatime

Key: noatime · Type: yes|no · Default: no · Values: yes, no

Open files with O_NOATIME so reading does not change the access time (Linux, file owner or root).

Noatime = yes

Exclude

Key: exclude · Type: yes|no · Default: no · Values: yes, no

The files matched by the patterns of this Options block are excluded instead of included.

Exclude = yes

Acl Support

Key: aclsupport · Type: yes|no · Default: yes · Values: yes, no

Back up POSIX and NFSv4 ACLs. Default yes in Bareos 25 and in the Onesimus Director.

Acl Support = no

Xattr Support

Key: xattrsupport · Type: yes|no · Default: yes · Values: yes, no

Back up extended attributes (for example SELinux labels). Default yes in Bareos 25.

Xattr Support = no

Ignore Case

Key: ignorecase · Type: yes|no · Default: no · Values: yes, no

Match Wild and Regex patterns without regard to case; useful for Windows clients.

Ignore Case = yes

Hfs Plus Support

Key: hfsplussupport · Type: yes|no · Default: no · Values: yes, no

On macOS: back up HFS+ resource forks and Finder information.

Hfs Plus Support = yes

Enhanced Wild

Key: enhancedwild · Type: yes|no · Default: no · Values: yes, no

Accepted for compatibility; the Director stores it like Noatime (the C++ Director does the same).

Enhanced Wild = no

Check File Changes

Key: checkfilechanges · Type: yes|no · Default: no · Values: yes, no

Check after reading a file whether it changed while it was saved, and warn if so.

Check File Changes = yes

Honor No Dump Flag

Key: honornodumpflag · Type: yes|no · Default: no · Values: yes, no

Skip files that carry the nodump flag (chattr +d).

Honor No Dump Flag = yes

Shadowing

Key: shadowing · Type: enum · Default: none · Values: none, localwarn, localremove, globalwarn, globalremove

Detects File lines that lie inside other File lines (and would be saved twice): warn about them or remove them, within this Include (local) or the whole FileSet (global).

Shadowing = localremove

Auto Exclude

Key: autoexclude · Type: yes|no · Default: yes · Values: yes, no

On Windows: honour the files the system lists as not to be backed up (FilesNotToBackup).

Auto Exclude = no

Verify

Key: verify · Type: string

Attributes compared by verify jobs, as option letters: i inode, p permissions, n links, u user, g group, s size, a atime, m mtime, c ctime, d size decrease, 5 MD5, 1 SHA1.

Verify = pins5

Accurate

Key: accurate · Type: string

Attributes compared in Accurate mode to decide whether a file changed, as option letters like Verify (default mcs: mtime, ctime and size).

Accurate = mcs

Strip Path

Key: strippath · Type: positive integer

Removes this many leading path components before the files are stored.

Strip Path = 1

Size

Key: size · Type: string

Select files by size: a size, a range (10k-1m) or a comparison (<1m, >1g).

Size = >1g

Wild

Key: wild · Type: pattern

Shell wildcard (* ? [ ]) matched against the full path; repeatable. Files that match are handled by this Options block (included, or excluded with Exclude = yes).

Wild = "*.iso"

Wild Dir

Key: wilddir · Type: pattern

Wildcard matched against directory paths only.

Wild Dir = "*/.cache"

Wild File

Key: wildfile · Type: pattern

Wildcard matched against file names (not directories); a pattern without / matches the base name.

Wild File = "*.tmp"

Regex

Key: regex · Type: pattern

POSIX extended regular expression matched against the full path; repeatable.

Regex = "\\.(mp4|mkv)$"

Regex Dir

Key: regexdir · Type: pattern

Regular expression matched against directory paths only.

Regex Dir = "/node_modules$"

Regex File

Key: regexfile · Type: pattern

Regular expression matched against file paths only.

Regex File = "\\.o$"

FS Type

Key: fstype · Type: string list

Only back up file systems of these types (ext4, xfs, btrfs, …). Together with One FS = no it selects the local file systems and skips proc, sysfs, tmpfs and network mounts.

FS Type = ext4, xfs, btrfs

Drive Type

Key: drivetype · Type: string list

On Windows: only back up drives of these types (fixed, removable, remote, cdrom, ramdisk).

Drive Type = fixed

Meta

Key: meta · Type: string list

Meta information passed to plugins.

Meta = "key=value"

Plugin

Key: plugin · Type: string

Plugin that handles the files of this Options block.

Plugin = "python3:module_name=x"

See also: configuration reference, configure, show