Excluding files from backup. (Addendum to the NetBackup Administrator's Guide)

Article: 100021742
Last Published: 2020-04-01
Ratings: 2 3
Product(s): NetBackup & Alta Data Protection

Description

How to exclude files from a backup. Addendum to the NetBackup™ Administrator's Guide, Volume I

To find the guide for your version, please see the NetBackup Documentation Landing Page, or NetBackup Support Documentation.

Creating an Exclude List on a UNIX Client

If you create a /usr/openv/netbackup/exclude_list file on a UNIX client, NetBackup uses the contents of the file as a list of patterns to skip during automatic full and incremental backups.

The following types of files typically appear in an exclude list:

  • *.o files
  • core files
  • a.out files
  • Files prefixed or suffixed by ~ (backups for editors)
  • Files and directories under /tmp, /usr/tmp
  • Man pages
  • Software that you can restore from original installation tapes
  • Automounted directories
  • CD-ROM file systems
  • NetBackup automatically excludes the following file system types:
  • mntfs (Solaris)
  • proc (all UNIX platforms)
  • cdrom (all UNIX platforms)
  • cachefs (AIX, Solaris, SGI, UnixWare)

Note: Veritas suggests that you always specify automounted directories and CD-ROM file systems in the exclude list. Otherwise, if they are not mounted at the time of a backup, NetBackup must wait for a timeout before proceeding. Check with users before excluding any files from their backups.

Syntax Rules

The following syntax rules apply to exclude lists:

  • Blank lines or lines beginning with a pound sign (#) are ignored.
  • Only one pattern per line is allowed.
  • The following special or wildcard characters are recognized:
    [ ]
    ?
    *
    { }
  • To use special or wildcard characters literally (that is, as nonwildcard characters), precede them with a backslash (\).
    • For example, assume the brackets in the following are to be used literally:
      /home/abc/fun[ny]name
    • In the exclude list, precede them with a backslash as in
      /home/abc/fun\[ny\]name

Note: A backslash (\) acts as an escape character only when it precedes a special or wildcard character as in the above example. This means that NetBackup normally interprets a backslash literally and it is a legal character to use in pathnames.

  • If you exclude all files in the backup selections list by using / or * or both symbols together (/*), NetBackup backs up only what is specified by full path names in the include list.
  • Spaces are considered legal characters. Do not include extra spaces unless they are part of the file name.
    • For example, if you want to exclude a file named "/home/testfile" (with no extra space character at the end) and your exclude list entry is "/home/testfile " (with an extra space character at the end) NetBackup cannot find the file until you delete the extra space from the end of the file name.
  • End a file path with / to exclude only directories with that path name (for example, /home/test/). If the pattern does not end in / (for example, /usr/test), NetBackup excludes both files and directories with that path name.
  • To exclude all files with a given name, regardless of their directory path, just enter the name without a preceding slash.
    • For example:
      test
      rather than
      /test
      This is equivalent to prefixing the file pattern with
      /
      /*/
      /*/*/
      /*/*/*/

      and so on.
  • Do not use patterns with links in the names.
    • For example, assume /home is a link to /usr/home and /home/doc is in the exclude list. The file is still backed up in this case because the actual directory path, /usr/home/doc, does not match the exclude list entry, /home/doc.

Example of an Exclude List

In this example, an exclude list contains the following entries:

# this is a comment line
/home/doe/john
/home/doe/abc/
/home/*/test
/*/temp
core

Given the exclude list above, the following files and directories are excluded from automatic backups:

  • The file or directory named /home/doe/john.
  • The directory /home/doe/abc (because the exclude entry ends with /).
  • All files or directories named test that are two levels below home.
  • All files or directories named temp that are two levels below the root directory.
  • All files or directories named core at any level.

Exclude Lists for Specific Policies or Schedules

NetBackup allows you to create an exclude list for a specific policy or a policy and schedule combination. To do this, create an exclude_list file with a .policyname or .policyname.schedulename suffix.

The following are two examples for a policy named workstations that contains a schedule named fulls:

Examples:
/usr/openv/netbackup/exclude_list.workstations
/usr/openv/netbackup/exclude_list.workstations.fulls

The first file affects all scheduled backups in the policy named workstations. The second file affects backups only when the schedule is named fulls.

For a given backup, NetBackup uses only one exclude list and that is the one with the most specific name.

  • For example, if there are files named: exclude_list.workstations and exclude_list.workstations.fulls NetBackup uses only: exclude_list.workstations.fulls

Creating an Include List on a UNIX Client

To add back in files that you eliminate with the exclude list, create a /usr/openv/netbackup/include_list file. The same syntax rules apply as explained previously for the exclude list. To illustrate the use of an include list, we use the example from the previous discussion.

The exclude list in that example causes NetBackup to omit all files or directories named test from all directories beneath /home/*/test.

In this case, add back in a file named /home/jdoe/test by creating a /usr/openv/netbackup/include_list file on the client and adding the following to it:

# this is a comment line
/home/jdoe/test

To create an include list for a specific policy or policy and schedule combination, use a .policyname or .policyname.schedulename suffix.

The following are two examples of include list names for a policy named workstations that contains a schedule named fulls.

Examples:
/usr/openv/netbackup/include_list.workstations
/usr/openv/netbackup/include_list.workstations.fulls

The first file affects all scheduled backups in the policy named workstations. The second file affects backups only when the schedule is named fulls.

For a given backup, NetBackup uses only one include list and that is the one with the most specific name.

  • For example, assume there are files such as the following:
    include_list.workstations and include_list.workstations.fulls
  • In such a case, NetBackup uses only the following:
    include_list.workstations.fulls

Was this content helpful?