Excluding Files from Backups
By default, Opsmate backs up all filesystems except for remote (e.g. NFS) or pseudo
Specific files and directories can be excluded by editing the file list,
/etc/opsmate/backups/file-list. Opsmate installs a default file list
that excludes files that generally should not be backed up (such as runtime data, caches,
and temporary files).
The format of the file list is a sequence of lines consisting of the operator
+ to include a file,
- to exclude a file), followed by
a space, followed by the path to include or exclude. Lines starting with a
- /var/tmp excludes
Paths may contain the following wildcard characters:
- A single asterisk (
*) matches zero or more characters, except for forward slash (
- A double asterisk (
**) matches zero or more characters, including forward slash (
The file list has the following semantics:
- Rules are processed from top to bottom, and the first rule to match a path takes precedence.
- A path ending in a slash (
/) matches only directories.
- If a path starts with a
/, it matches the entire path. If it does not start with a
/, only the last component(s) of the path are matched. (Example: to exclude all
.ofiles everywhere, use
- *.o; to exclude
.ofiles only in the root, use
- A single asterisk (
*) has to match exactly one path component, whereas a double asterisk (
**) matches any number of path components, including zero. (Example:
/src/*/coredoes not match
- If a directory is included/excluded, so are all of its descendants, unless an earlier rule explicitly includes or excludes a descendant.
Paths are included by default if no rule matches them. This behavior can be changed by adding a catch-all
- * rule to the bottom of the file list. See Backing Up Specific Directories for details.
Including an Excluded Filesystem
To include a remote or pseudo filesystem that would normally be excluded, add an explicit rule for its mount point to your file list:
Be warned that pseudo filesystems often have strange semantics that may confuse Opsmate, and remote filesystems may take a long time to back up. If possible, run Opsmate directly on the file server rather than backing it up via a remote mount.
# Exclude all files named core:
# Exclude all files whose names end in ~:
# Exclude /etc/random-seed:
# Exclude all descendants of the /tmp directory:
# Exclude all descendants of /var/cache, except for /var/cache/apt:
# Exclude all files under /home/andrew/src whose names end in .o:
Note that order is important in this example. The rule to include
must come before excluding
/var/cache/*, or else it
would have no effect. The rules for excluding
*~ must come before the rule to include
or else they would have no effect inside