6. Basic exclude examples
The basic syntax for coding exclusions from backup may be gleaned from the existing examples in the TSM option files. The following is a summary to illustrate some of the possibilities offered.
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 Exclude.Dir, Exclude or Include)
as the entry for
Type, and then entering the second element
under File or Pattern.
- The default is to include a file for backup. If a file does not match either an
ExcludeorIncludedirective 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, theExcludedirective 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.dirdirective: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 fileExclude.dir C:\testdata Include C:\testdata\test1\summary.datthen the file "summary.dat" will not be backed up even though theIncludedirective is below theExclude.dirdirective. TheExclude.dirdirectives are read and processed first.- To check the order in which exclude directives are processed open the TSM command line client and at
the
tsm>prompt enterquery 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
*and?wildcards. The*matches any number of any character; the?matches any single character. Thus to exclude any files whose names begintempin theC:\tempdatafolder use: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:Exclude C:\tempdata\?_temp.dat - To exclude numerous directories use the
...wildcard. Thus to exclude a directory calledcacheand all its contents and sub-directories anywhere on driveC:, use:Exclude.dir C:\...\cacheIf, however, you have 100 directories calledtemp00,temp01,temp02and so on up totemp99on theC: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 underC:\data. Note the order is important: TheExcludedirective must follow theIncludedirective 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 theC:\datadirectory.
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 and Linux. Alternatively, restarting your machine will have the same effect as restarting the TSM scheduler.
Up: Contents Previous: 5. Excluding everything from backup except specific files or folders

