TSM - How to configure the include exclude file to exclude files from the backup

 

Excluding file spaces and directories

Use exclude.fs and exclude.dir statements to exclude file spaces and all files and sub-directories in the specified directory from processing. Tivoli Storage Manager evaluates all exclude.fs and exclude.dir statements first (regardless of their position within the include-exclude list), and removes the excluded file spaces, directories, and files from the list of objects available for processing. The exclude.fs and exclude.dir statements override all include statements that match the pattern.

 

Processing Include and Exclude Options

Include-exclude options can be defined on the server using the inclexcl parameter. The include-exclude statements specified by the server are evaluated along with those in the client options file. The server include-exclude statements are always enforced and placed at the bottom of the include-exclude list and evaluated before the client include-exclude statements. TSM processes the include-exclude list from the bottom up, and stops when it finds an include or exclude statement that matches the file it is processing. The order in which the include and exclude options are listed therefore affects which files are included and excluded. See Chapter 8, "Setting Common Options" for more information about the order in which all options are processed.

The TSM client program processes the include and exclude options as follows:

  1. Files are checked; directories are only checked if the exclude.dir option is specified. You can use the exclude.dir option in your options file to exclude directories and subdirectories from backup. See Exclude Options for more information.

  2. Options are checked from the bottom of the include-exclude list up, until a match is found. However, on full incremental backups exclude.fs statements take precedence over other include-exclude statements, regardless of their position in the include-exclude list. See Exclude Options for more information. If a match is found, the processing stops and checks whether the option is include or exclude. If the option is include, the file is backed up. If the option is exclude, the file is not backed up.

  3. If a match is not found, files listed are implicitly included and backed up.

  4. If policy administration is in effect, files are backed up according to the default management class, or the management class you specify.

The following examples demonstrate bottom up processing.

Example 1

Assume that /home is defined as the domain, and you defined the following statements for the include and exclude options:

exclude *.obj
include /home/foo/.../*.obj
exclude /home/foo/junk/*.obj

The file that processes is: /home/foo/dev/test.obj. Processing follows these steps:

  1. Rule 3 (the last include or exclude statement defined) is checked first because of bottom up processing. The file /home/foo/junk/*.obj does not match the file name that is being processed.

  2. Processing moves to Rule 2 and checks. This time, file /home/foo/.../*.obj matches the file name that is being processed. Processing stops, the option is checked, and it is include.

  3. File /home/foo/dev/test.obj is backed up.

Example 2

Assume that /home is defined as the domain, and you defined the following statements for the include and exclude options:

exclude *.obj
include /home/foo/.../*.obj
exclude /home/foo/junk/*.obj

The file that processes is: /home/widg/copyit.bat. Processing follows these steps:

  1. Rule 3 is checked and finds no match.

  2. Rule 2 is checked and finds no match.

  3. Rule 1 is checked and finds no match.

  4. Because a match is not found, file /home/widg/copyit.bat is implicitly included and backed up.

Example 3

Assume that /home is defined as the domain, and you defined the following statements for the include and exclude options:

exclude /.../*.obj
include /home/foo/.../*.obj
exclude /home/foo/junk/*.obj

The current file that processes is: /home/lib/objs/printf.obj. Processing follows these steps:

  1. Rule 3 is checked and finds no match.

  2. Rule 2 is checked and finds no match.

  3. Rule 1 is checked and a match is found.

  4. Processing stops, the option is checked, and it is exclude.

  5. File /home/lib/objs/printf.obj is not backed up.

 

Include-Exclude Options

exclude Excludes a file or group of files from backup services and space management services (if the TSM HSM client is installed). Any file in your client domain that is not specifically excluded with this option is considered for backup.

exclude.archive Excludes a file or group of files from archive services.

exclude.backup Excludes a file or a group of files from normal backup services, but not from HSM.

exclude.dir Locates matching directory names. If a matching directory is found, that directory, its files, and all its subdirectories and their files are excluded from backup services.

exclude.file Excludes files, but not directories, that match a pattern.

exclude.file.backup Excludes a file from normal backup services.

exclude.file.spacemgmt Excludes a file from hierarchical space management services (HSM) only. Use this option when you have both the backup-archive client and the HSM client installed.

exclude.fs Excludes file spaces matching a pattern.

exclude.image Excludes mounted file systems and raw logical volumes that match the pattern from image processing. This option is valid for AIX, HP-UX, and Solaris only.

exclude.spacemgmt Excludes a group of files from HSM backup only. Use this option when you have both the backup-archive client and the HSM client installed.

include Includes files or management classes for backup or archive processing.

include.file Includes a file for backup services, or assigns a management class to a file.

include.image Includes a file space or logical volume, or assigns a management class when used with the backup image command. The backup image command ignores all other include options. This option is valid for AIX, HP-UX, and Solaris clients only.

 

Restart the TSM client

Restart your Tivoli Storage Manager client to enable your include-exclude list.

To restart the daemon do the following

ps -ef | grep dsm

Find the process ID of dsmc sched

kill -1 process_id

 

Checking the include exclude status

To check the order in which exclude directives are processed type the following.

dsmc q inclexcl

The output will list the directives in the order in which they will be applied.

After a backup is run check the contents of the dsmsched.log file to determine if the files and directories are being excluded or included as you expect.

If you can't see a file or directory included in the backup it may just be because the file or directory has not changed. Remember an incremental backup only backs up changes. To check, create a test file in the directory you wish to test and run a manual incremental backup of that directory. If your include exclude file is configured correctly the test file should get backed up. Run the following command to backup the relevant directory.

dsmc i -subd=y "/test_dir/test_subdir/*"