6. Basic exclude examples
Each line in each of the following examples is made up of two elements. The lines can be entered at the end of the TSM configuration file as described above in e.g.
excluding files from backup by editing the TSM configuration file. They may also be used in the graphical user
interface as described in excluding files from backup using the graphical user interface by selecting
the first element (usually
as the entry for
Type, and then entering the second element
File or Pattern.
- The default is to include a file for backup. If a file does not match either an
Includedirective in the configuration file then it will be included for backup.
- The include/exclude list is processed bottom up. If you add the following two lines to
the bottom of the configuration file
Include C:\XYZ.DOC Exclude C:\XYZ.DOCthen the file XYZ.DOC will not be backed up. The processor will read the list from bottom up, and acts on the first, and only the first, directive that applies. In this case, the
Excludedirective is read first, applied and the processor then grabs the next file and so on.
- To specify a directory path or filename with spaces in it, enclose it fully in quotation marks, as below:
Exclude "C:\My Documents\tempfiles\*" Exclude "C:\Program Files\xyz\*"
- To exclude the contents of a directory and all its subdirectories, use the
Exclude.dir C:\testdataNote, however, that a perhaps unexpected outcome of this rule is that the names of the directory that is excluded will be sent to the HFS and will so be displayed in the restore window when you perform a restore. However, the file contents of such directories will not be displayed, as they will have been excluded.
Exclude.dirdirectives are processed before all other directives. If you added the following two lines to the bottom of the configuration file
Exclude.dir C:\testdata Include C:\testdata\test1\summary.datthen the file "summary.dat" will not be backed up even though the
Includedirective is below the
Exclude.dirdirectives are read and processed first.
- To check the order in which exclude directives are processed open the TSM command line client and at
query inclexclas below:
tsm> query inclexclThe output will list the directives in the order in which they will be applied. As described above, you may also check what data may be backed up by running the GUI and browsing the files on your machine: TSM will not permit excluded files to be backed up, and will mark them with a barred red circle to indicate this.
- To exclude multiple files with a common component in their name, use
*matches any number of any character; the
?matches any single character. Thus to exclude any files whose names begin
Exclude C:\tempdata\temp*To exclude any files whose names begin with a variable single character then followed by
_temp.datin the C:\tempdata directory, use:
- To exclude numerous directories use the
...wildcard. Thus to exclude a directory called
cacheand all its contents and sub-directories anywhere on drive
Exclude.dir C:\...\cacheIf, however, you have 100 directories called
temp02and so on up to
C:drive, then you can do either of the following:
Exclude.dir C:\temp* Exclude.dir C:\temp??
- To exclude the contents of a directory but include the contents of all its sub-directories:
Include C:\data\...\* Exclude C:\data\*This will exclude any file in the C:\data directory but will include for backup any file in any subdirectory under
C:\data. Note the order is important: The
Excludedirective must follow the
Includedirective in the configuration file.
- To do the reverse and include the contents of a directory but exclude the
contents of all its sub-directories:
Include C:\data\* Exclude.dir C:\data\...\*This will exclude any file in any sub-directory of C:\data but will include for backup any file in the
If you use the automatic scheduled backups, you must now restart the TSM scheduler after making changes to the exclude rules. If you do not do this then the change(s) that you have made will not be honoured on the scheduled backups. Please see our instructions for restarting the scheduler for Windows, Mac, Linux and Solaris. Alternatively, restarting your machine will have the same effect as restarting the TSM scheduler.