## 2. Excluding files from backup

### 2.1. Introduction

You can exclude files from backup either in the TSM graphical user interface (GUI) or by editing the TSM configuration file. The former is generally the simpler and easier method to use.

### 2.2. Excluding files from backup using the graphical user interface

To exclude a file or a range of similar files from backup in the graphical user interface, do as follows:
1. Run TSM: in Windows, run TSM from > > > ; on a Mac, run TSM from > > ; in Linux, run dsmj as root. The following window will appear.

Figure 1.
2. Click on Edit, then Client Preferences. The Preferences Editor window will appear, on the General Preferences section:

Figure 2.
3. From the list of tabs on the left, click on Include-Exclude. The list of current Include-Exclude Preferences will appear:

Figure 3.
4. Click on Add and the Define Include-Exclude Options window will appear. Under Category select Backup, and under Type select Exclude:

Figure 4.
5. Under File or Pattern, click Browse, and a window headed File or Pattern will appear in which you can browse to a file that you want to exclude.

Figure 5.
6. Browse to and select your file, and click OK. The file will now be listed in the Define Include-Exclude Options window:

Figure 6.
7. Depending on how many files you need to exclude, proceed as follows:

• If this is the only file you wish to exclude, proceed to the next step.

• If there are a few more files to exclude, repeat the previous three steps as often as is needed.

• If there is a range of similarly-named or similarly-located files that you wish to exclude, you can edit the exclude line to match a range of files before clicking OK. For further details and for examples of exclude rule syntax, please see basic exclude examples below.

8. Once your exclude rules are completed, click OK in the Define Include-Exclude Options window and then OK again in the Preferences Editor. This will take you back to the main TSM window.

9. Now verify that your new exclude rule(s) is/are working correctly. The easiest way to do this is in the TSM graphical user interface, by attempting to perform a manual backup of one or more of your excluded files: it should be marked with a barred red circle, and so impossible to back up (TSM will not permit you to back up any files or folders that are marked in this way):

Figure 7.

For how to run a manual backup, please see our instructions for doing so on Windows, Mac, Linux or Solaris.

10. Lastly, 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 and and Solaris. Alternatively, restarting your machine will have the same effect as restarting the TSM scheduler.

### 2.3. Excluding files from backup by editing the TSM configuration file

To exclude a file or a range of similar files by editing the TSM configuration file, do as follows:
1. Locate the TSM configuration file: it is dsm.opt in Windows, dsm.sys on a Mac or in Linux (although please note that very old TSM clients for Linux/Unix stored the list in a file called incl.excl). The location of the configuration file is platform-specific and can be looked up in our list of TSM Options Files.

2. In Windows Vista, 7, 2008 and 2008R2, permissions to edit the contents of C:\Program Files are limited. We therefore recommend that you move dsm.opt to the desktop before you open it for editing. Users of these versions of Windows should therefore browse to C:\Program Files\tivoli\tsm\baclient and drag dsm.opt to their desktop. (An alternative is to run your text editor as administrator before using it to open dsm.opt.)

3. Now edit the TSM configuration file in a text editor and add the necessary additional exclude rule(s) to the end of the file. Please do not alter or remove any existing rules or other lines of dsm.opt/dsm.sys. For example, to exclude file C:\Users\jasonz\Documents\to-be-excluded-1.docx, add:

exclude "C:\Users\jasonz\Documents\to-be-excluded-1.docx"
Note that quotation marks are not optional if the file name or location contains a space.

If there is a range of similarly-named or similarly-located files that you wish to exclude, you can change your exclude line to match a range of files. For further details and for examples of exclude rule syntax, please see basic exclude examples below.

4. Save the TSM configuration file. If you moved it from C:\Program Files to your desktop in order to edit it, now move it back.

5. Now verify that your new exclude rule(s) is/are working correctly. The easiest way to do this is in the TSM graphical user interface, by attempting to perform a manual backup of one or more of your excluded files: it should be marked with a barred red circle, and so impossible to back up (TSM will not permit you to back up any files or folders that are marked in this way):

Figure 8.

For how to run a manual backup, please see our instructions for doing so on Windows, Mac, Linux or Solaris.

If you cannot use the graphical interface then you can check the include-exclude list on the TSM command line by running:

dsmc q inclexcl
Note that the output lists the order in which the directives will be processed.

6. Lastly, 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.