1. What do you want to exclude from backup?
The HFS TSM package comes with a set of default exclusions coded in the TSM configuration file: on these please see further our page on files and folders excluded from backup. While these default exclusions should not generally be modified or removed, they can be added to.
So that we can provide you with the best advice, please select the type of exclude rule that you need from the following list:
- I want to exclude one or more specific files, or a range of similar files:
- see excluding files.
- I want to exclude one or more folders:
- see excluding folders.
- I want to exclude one or more drives or partitions:
- see excluding drives or partitions.
- I want to exclude everything except certain files or folders:
- see excluding everything specific files or folders.
- I am experienced with TSM exclude rules and want to see basic examples of the different options available:
- see basic exclude examples.
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
-
Run TSM: in Windows, run TSM from
[Start]>[All Programs]>[Tivoli Storage Manager]>[Backup-Archive GUI]; on a Mac, run TSM from[Applications]>[TSM Tools for Administrators]>[Tivoli Storage Manager]; in Linux, rundsmjas root. The following window will appear. Click on
Edit, thenClient Preferences. ThePreferences Editorwindow will appear, on theGeneral Preferencessection:From the list of tabs on the left, click on
Include-Exclude. The list of currentInclude-Exclude Preferenceswill appear:Click on
Addand theDefine Include-Exclude Optionswindow will appear. UnderCategoryselectBackup, and underTypeselectExclude:Under
File or Pattern, clickBrowse, and a window headedFile or Patternwill appear in which you can browse to a file that you want to exclude.-
Browse to and select your file, and click
OK. The file will now be listed in theDefine Include-Exclude Optionswindow: 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.
-
Once your exclude rules are completed, click
OKin theDefine Include-Exclude Optionswindow and thenOKagain in thePreferences Editor. This will take you back to the main TSM window. -
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):
For how to run a manual backup, please see our instructions for doing so on Windows, Mac or Linux.
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. 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
-
Locate the TSM configuration file: it is
dsm.optin Windows,dsm.syson a Mac or in Linux (although please note that very old TSM clients for Unix/Linux stored the list in a file calledincl.excl). The location of the configuration file is platform-specific and can be looked up in our list of TSM Options Files. -
In Windows Vista, 7, 2008 and 2008R2, permissions to edit the contents of
C:\Program Filesare limited. We therefore recommend that you movedsm.optto the desktop before you open it for editing. Users of these versions of Windows should therefore browse toC:\Program Files\tivoli\tsm\baclientand dragdsm.optto their desktop. (An alternative is to run your text editor as administrator before using it to opendsm.opt.) -
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 fileC:\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.
-
Save the TSM configuration file. If you moved it from
C:\Program Filesto your desktop in order to edit it, now move it back. -
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):
For how to run a manual backup, please see our instructions for doing so on Windows, Mac or Linux.
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. 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. Alternatively, restarting your machine will have the same effect as restarting the TSM scheduler.
3. Excluding folders from backup
3.1. Introduction
You can exclude folders 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.
Please note that these instructions are only valid for folders and cannot be used for the top-level of a drive or partition, or
for a mountpoint.
If you wish to exclude e.g. E: (Windows), /Volumes/ExternalDrive (Mac), or
/home where /home is a
file system or mountpoint, please see instead excluding one or more drives or partitions.
3.2. Excluding files from backup using the graphical user interface
-
Run TSM: in Windows, run TSM from
[Start]>[All Programs]>[Tivoli Storage Manager]>[Backup-Archive GUI]; on a Mac, run TSM from[Applications]>[TSM Tools for Administrators]>[Tivoli Storage Manager]; in Linux, rundsmjas root. The following window will appear. Click on
Edit, thenClient Preferences. ThePreferences Editorwindow will appear, on theGeneral Preferencessection:From the list of tabs on the left, click on
Include-Exclude. The list of currentInclude-Exclude Preferenceswill appear:Click on
Addand theDefine Include-Exclude Optionswindow will appear. UnderCategoryselectBackup, and underTypeselectExclude.Dir:Under
File or Pattern, clickBrowse, and a window headedFile or Patternwill appear in which you can browse to a folder that you want to exclude.-
Browse to and select your folder, and click
OK. The folder will now be listed in theDefine Include-Exclude Optionswindow: Depending on how many folders you need to exclude, proceed as follows:
If this is the only folder you wish to exclude, proceed to the next step.
If there are a few more folders to exclude, repeat the previous three steps as often as is needed.
If there is a range of similarly-named or similarly-located folders that you wish to exclude, you can edit the exclude line to match a range of folders before clicking
OK. For further details and for examples of exclude rule syntax, please see basic exclude examples below.
-
Once your exclude rules are completed, click
OKin theDefine Include-Exclude Optionswindow and thenOKagain in thePreferences Editor. This will take you back to the main TSM window. -
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 your excluded folder: it should be marked with a barred red circle, and its contents should not be visible, so that it is impossible to back up (TSM will not permit you to back up any files or folders that are marked in this way):
For how to run a manual backup, please see our instructions for doing so on Windows, Mac or Linux.
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. Alternatively, restarting your machine will have the same effect as restarting the TSM scheduler.
3.3. Excluding folders from backup by editing the TSM configuration file
-
Locate the TSM configuration file: it is
dsm.optin Windows,dsm.syson a Mac or in Linux (although please note that very old TSM clients for Unix/Linux stored the list in a file calledincl.excl). The location of the configuration file is platform-specific and can be looked up in our list of TSM Options Files. -
In Windows Vista, 7, 2008 and 2008R2, permissions to edit the contents of
C:\Program Filesare limited. We therefore recommend that you movedsm.optto the desktop before you open it for editing. Users of these versions of Windows should therefore browse toC:\Program Files\tivoli\tsm\baclientand dragdsm.optto their desktop. (An alternative is to run your text editor as administrator before using it to opendsm.opt.) -
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 folderC:\Users\jasonz\Documents\to-be-excluded, add:exclude.dir "C:\Users\jasonz\Documents\to-be-excluded"
Do not put a slash at the end of the rule or this will invalidate the whole rule, which TSM will then ignore. 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 folders 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.
-
Save the TSM configuration file. If you moved it from
C:\Program Filesto your desktop in order to edit it, now move it back. -
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 your excluded folder: it should be marked with a barred red circle, and its contents should not be visible, so that it is impossible to back up (TSM will not permit you to back up any files or folders that are marked in this way):
For how to run a manual backup, please see our instructions for doing so on Windows, Mac or Linux.
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. 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. Alternatively, restarting your machine will have the same effect as restarting the TSM scheduler.
4. Excluding drives and partitions from backup
By default, TSM is set to back up all your local drives and partitions. This includes not only those internal to your machine, but also those that are attached externally, such as Firewire/USB hard drives and flash drives. This section shows how to exclude these from backup. If you have accidentally backed up an external drive and do not want the data to be kept for backup, please contact hfs@ox.ac.uk and indicate which drive's backup you wish to be deleted.
You can exclude a drive or partition 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. You can exclude a drive or partition from backup either by altering the backup
domain that TSM
checks when it runs a scheduled backup, or alternatively with an exclude rule.
An exclude.dir rule cannot be used to exclude a whole partition because its role is
only to exclude folders that exist within a drive, not whole drives themselves.
4.1. Excluding drives and partitions by changing the backup domain
TSM reads the backup domain setting when it runs a scheduled backup. Changing the backup domain therefore affects which drives and partitions
get backed up on the schedule.
Drives excluded in this manner may still be backed up manually, and are still listed under the 'Local' list
of disks in the TSM interface when you run a manual backup; so you may want to expand this list and select only those disks you wish to
back up if you do run a manual backup. (Similarly, command line users can include
such drives as an argument, as in dsmc incr "/media/USB DISK", for example, while a simple dsmc incr
will honour the domain setting you have made in the graphical user interface and not back up drives which are not listed in the backup domain.)
4.1.1. Changing the backup domain using the graphical user interface
-
Run TSM: in Windows, run TSM from
[Start]>[All Programs]>[Tivoli Storage Manager]>[Backup-Archive GUI]; on a Mac, run TSM from[Applications]>[TSM Tools for Administrators]>[Tivoli Storage Manager]; in Linux, rundsmjas root. The following window will appear. Click on
Edit, thenClient Preferences. ThePreferences Editorwindow will appear, on theGeneral Preferencessection:From the list of tabs on the left, click on
Backup. TheBackup Preferenceswindow will appear:-
Under
Domain for Backup, untickBack up all local file systems, and select those drives that you want to include for backup. In the example below, onlyC:will get backed on the backup schedule, notE:(Windows desktop/laptop users can ignore the third line,SystemState, because for their accounts it is by default not backed up).Note: on Macs, TSM represents the main drive with a slash
/, rather than the complete volume name. Other disk volumes are named in the standard Mac manner, as e.g./Volumes/My Big External Disk. -
Now verify that the backup domain is now set correctly. The easiest way to do this is in the TSM graphical user interface, by attempting to perform a domain backup of your machine. To do this, from the main TSM window, click on
[Actions]and then[Backup Domain]. This will back up only those drives listed in the backup domain. 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. Alternatively, restarting your machine will have the same effect as restarting the TSM scheduler.
4.1.2. Changing the backup domain by editing the TSM configuration file
-
Locate the TSM configuration file: the backup domain is set in
dsm.opton all operating systems. The location of this file is platform-specific and can be looked up in our list of TSM Options Files. -
In Windows Vista, 7, 2008 and 2008R2, permissions to edit the contents of
C:\Program Filesare limited. We therefore recommend that you movedsm.optto the desktop before you open it for editing. Users of these versions of Windows should therefore browse toC:\Program Files\tivoli\tsm\baclientand dragdsm.optto their desktop. (An alternative is to run your text editor as administrator before using it to opendsm.opt.) -
Now edit the
DOMAINline ofdsm.optin a text editor. Please do not alter or remove any existing rules or other lines ofdsm.opt. The default setting is:DOMAIN ALL-LOCAL
To remove a drive from the backup domain, change theDOMAINline to be the appropriate line below:Windows - to back up only drive C: and E:: DOMAIN C: E: Mac - to back up the main drive and a secondary drive called "My Big External Disk": DOMAIN "/" "/Volumes/My Big External Disk" Linux: DOMAIN / /home
Note: on Macs, TSM represents the main drive with a slash
/, rather than the complete volume name. Other disk volumes are named in the standard Mac manner, as e.g./Volumes/My Big External Disk.These lines are cumulative, so, for example, you could put on two separate lines:
DOMAIN C: DOMAIN E:
or you can include all local drives / partitions and then exclude one or more by prefacing theme with a "-" minus sign, as below (note when enclosing the disk/partition name in quotation marks because it contains spaces, you should put the minus sign inside the quotation marks):Windows: DOMAIN ALL-LOCAL -F: Mac: DOMAIN ALL-LOCAL "-/Volumes/My Big External Disk" Linux: DOMAIN ALL-LOCAL -/usr -/scratch
Note that quotation marks are not optional if the file name or location contains a space. -
Save the TSM configuration file. If you moved it from
C:\Program Filesto your desktop in order to edit it, now move it back. -
Now verify that the backup domain is set correctly. The easiest way to do this is in the TSM graphical user interface, by attempting to perform a domain backup of your machine. To do this, from the main TSM window, click on
[Actions]and then[Backup Domain]. This will back up only those drives listed in the backup domain. Alternatively, if you prefer to run TSM on the command line, run as root:dsmc incr
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. Alternatively, restarting your machine will have the same effect as restarting the TSM scheduler.
4.2. Excluding drives and partitions from backup with an exclude rule
Alternatively you can completely exclude all files on a drive/partition from being backed up by adding an
exclude rule. Note that
an exclude.dir rule cannot be used to exclude a whole partition because its role is
only to exclude folders that exist within a drive, not whole drives themselves.
4.2.1. Excluding drives and partitions from backup with an exclude rule using the graphical user interface
-
Run TSM: in Windows, run TSM from
[Start]>[All Programs]>[Tivoli Storage Manager]>[Backup-Archive GUI]; on a Mac, run TSM from[Applications]>[TSM Tools for Administrators]>[Tivoli Storage Manager]; in Linux, rundsmjas root. The following window will appear. Click on
Edit, thenClient Preferences. ThePreferences Editorwindow will appear, on theGeneral Preferencessection:From the list of tabs on the left, click on
Include-Exclude. The list of currentInclude-Exclude Preferenceswill appear:Click on
Addand theDefine Include-Exclude Optionswindow will appear. UnderCategoryselectBackup, and underTypeselectExclude:Under
File or Pattern, clickBrowse, and a window headedFile or Patternwill appear in which you can browse to any file on the drive that you want to exclude.-
Browse to and select any file on the drive that you want to exclude, and click
OK. The file will now be listed in theDefine Include-Exclude Optionswindow: Now edit the
File or Patternfield so that, after the drive name, it reads either\...\*(Windows) or/.../*(Mac/Linux). The example below is for excluding all ofC:on Windows. So you will have a result that looks like one of:Windows: C:\...\* Mac: "/Volumes/My Big External Disk/.../*" Linux: /scratch/.../*
A simpler alternative, available in Linux only, is to select the
TypeoptionExclude.fsrather thanExclude. You can then browse to the file system to be excluded with theBrowsebutton.-
Once your exclude rule is completed, click
OKin theDefine Include-Exclude Optionswindow and thenOKagain in thePreferences Editor. This will take you back to the main TSM window. -
Now verify that your new exclude rule is working correctly. The easiest way to do this is in the TSM graphical user interface, by attempting to perform a manual backup of your excluded drive, and also by checking that you can still back up those files that you want to back up: every file on the excluded drive 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):
For how to run a manual backup, please see our instructions for doing so on Windows, Mac or Linux.
Note that you will still be able to select folders for backup, but that in all cases the files inside them should be marked as excluded.
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. Alternatively, restarting your machine will have the same effect as restarting the TSM scheduler.
4.2.2. Excluding drives and partitions from backup with an exclude rule by editing the TSM configuration file
-
Locate the TSM configuration file: it is
dsm.optin Windows,dsm.syson a Mac or in Linux (although please note that very old TSM clients for Unix/Linux stored the list in a file calledincl.excl). The location of the configuration file is platform-specific and can be looked up in our list of TSM Options Files. -
In Windows Vista, 7, 2008 and 2008R2, permissions to edit the contents of
C:\Program Filesare limited. We therefore recommend that you movedsm.optto the desktop before you open it for editing. Users of these versions of Windows should therefore browse toC:\Program Files\tivoli\tsm\baclientand dragdsm.optto their desktop. (An alternative is to run your text editor as administrator before using it to opendsm.opt.) -
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. Add an exclude rule that begins with the drive name and ends with either\...\*(Windows) or/.../*(Mac/Linux). So you will have a result that looks like one of:Windows: Exclude C:\...\* Mac: Exclude "/Volumes/My Big External Disk/.../*" Linux: Exclude /scratch/.../*
A alternative in Linux only is the optionExclude.fs, after which you can name the drive to be excluded. Do not put a slash at the end of the rule or this will invalidate the whole rule, which TSM will then ignore.Linux: Exclude.fs /scratch
Note that quotation marks are not optional if the file name or location contains a space. -
Save the TSM configuration file. If you moved it from
C:\Program Filesto your desktop in order to edit it, now move it back. -
Now verify that your new exclude rule is working correctly. The easiest way to do this is in the TSM graphical user interface, by attempting to perform a manual backup of your excluded drive, and also by checking that you can still back up those files that you want to back up: every file on the excluded drive 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):
For how to run a manual backup, please see our instructions for doing so on Windows, Mac or Linux.
Note that you will still be able to select folders for backup, but that in all cases the files inside them should be marked as excluded.
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. 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. Alternatively, restarting your machine will have the same effect as restarting the TSM scheduler.
5. Excluding everything from backup except specific files or folders
5.1. Introduction
You may wish to exclude all your data from backup except a specific part of your data. If you keep all your important files in one place then there is no need to back up the rest of your machine. This is especially useful if you are backing up from home over VPN using a VPN-based backup account because such backups are often very slow.
The method used is to include all your important files and to exclude everything else from backup. You will therefore need to add two rules to your TSM include-exclude list. This can be done 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.
5.2. Excluding everything from backup except specific files or folders using the graphical user interface
-
Run TSM: in Windows, run TSM from
[Start]>[All Programs]>[Tivoli Storage Manager]>[Backup-Archive GUI]; on a Mac, run TSM from[Applications]>[TSM Tools for Administrators]>[Tivoli Storage Manager]; in Linux, rundsmjas root. The following window will appear. Click on
Edit, thenClient Preferences. ThePreferences Editorwindow will appear, on theGeneral Preferencessection:From the list of tabs on the left, click on
Include-Exclude. The list of currentInclude-Exclude Preferenceswill appear:Click on
Addand theDefine Include-Exclude Optionswindow will appear. UnderCategoryselectBackup, and underTypeselectExclude:-
Under
File or Pattern, you now need to enter a line that excludes all your data from backup. What you enter depends on your operating system: paste in the relevant text from the list below, depending on whether you are running Windows, Mac or Linux:Windows: *:\...\* Mac/Linux: /.../*
-
Enter the relevant text under
File or Patternand clickOK, then again onAddso that theDefine Include-Exclude Optionswindow appears again. A second time, underCategoryselectBackup, but underTypethis time selectInclude(ignore the extra option that appears,Management Class): Under
File or Pattern, clickBrowse, and a window headedFile or Patternwill appear in which you can browse to any file on the drive that you want to include.-
Browse to and select any file on the drive that you want to include, and click
OK. The file will now be listed in theDefine Include-Exclude Optionswindow: Now edit the
File or Patternfield so that, after the name of the folder that you wish to be included, it reads either\...\*(Windows) or/.../*(Mac/Linux). The example below is for including all ofC:\Users\jasonzon Windows.-
Click
OKin theDefine Include-Exclude Optionswindow. This will take you back to thePreferences Editor. UnderInclude-Exclude Preferences, scroll down theStatement Listand check that the rules which you added are at the bottom of the list, in the order you created them in: it is important that theincluderule is at the bottom. (If they are not, use theMove Upand/orMove Downbuttons to rearrange them.) If you are including your home directory and you substitute your username for 'YOUR_NAME' then you should have a resulting pair that looks like one of:Windows XP/2003: Exclude "*:\...\*" Include "C:\Documents and Settings\YOUR_NAME\...\*" Windows Vista/2008/7: Exclude "*:\...\*" Include "C:\Users\YOUR_NAME\...\*" Mac: Exclude "/.../*" Include /Users/YOUR_NAME/.../* Linux: Exclude "/.../*" Include "/home/.../*"This combination will back up every file in a home/user area, and in any subdirectories under that directory, and exclude all other files on the system. Click
OKagain in thePreferences Editor. This will take you back to the main TSM window.-
Now verify that your new exclude rule is working correctly. The easiest way to do this is in the TSM graphical user interface, by attempting to perform a manual backup of your excluded data, and also by checking that you can still back up those files that you want to back up: every file on the excluded drive 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):
For how to run a manual backup, please see our instructions for doing so on Windows, Mac or Linux.
Note that you will still be able to select folders for backup, but that in all cases (except those that you deliberately included for backup) the files inside them should be marked as excluded.
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. Alternatively, restarting your machine will have the same effect as restarting the TSM scheduler.
5.3. Excluding everything from backup except specific files or folders by editing the TSM configuration file
-
Locate the TSM configuration file: it is
dsm.optin Windows,dsm.syson a Mac or in Linux (although please note that very old TSM clients for Unix/Linux stored the list in a file calledincl.excl). The location of the configuration file is platform-specific and can be looked up in our list of TSM Options Files. -
In Windows Vista, 7, 2008 and 2008R2, permissions to edit the contents of
C:\Program Filesare limited. We therefore recommend that you movedsm.optto the desktop before you open it for editing. Users of these versions of Windows should therefore browse toC:\Program Files\tivoli\tsm\baclientand dragdsm.optto their desktop. (An alternative is to run your text editor as administrator before using it to opendsm.opt.) -
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. You first need to add an exclude rule to exclude all data on your system, which will be of the form*:\...\*(Windows) or/.../*(Mac/Linux). This should be followed by a second line which specifies the folder that you wish to include, followed by\...\*(Windows) or/.../*(Mac/Linux). It is important that theincluderule is at the bottom. If you are including your home directory and you substitute your username for 'YOUR_NAME' then you should have a resulting pair that looks like one of:Windows XP/2003: Exclude "*:\...\*" Include "C:\Documents and Settings\YOUR_NAME\...\*" Windows Vista/2008/7: Exclude "*:\...\*" Include "C:\Users\YOUR_NAME\...\*" Mac: Exclude "/.../*" Include /Users/YOUR_NAME/.../* Linux: Exclude "/.../*" Include "/home/.../*"This combination will back up every file in a home/user area, and in any subdirectories under that directory, and exclude all other files on the system.Note that quotation marks are not optional if the file name or location contains a space.
-
Save the TSM configuration file. If you moved it from
C:\Program Filesto your desktop in order to edit it, now move it back. -
Now verify that your new exclude rule is working correctly. The easiest way to do this is in the TSM graphical user interface, by attempting to perform a manual backup of your excluded data, and also by checking that you can still back up those files that you want to back up: every file on the excluded drive 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):
For how to run a manual backup, please see our instructions for doing so on Windows, Mac or Linux.
Note that you will still be able to select folders for backup, but that in all cases (except those that you deliberately included for backup) the files inside them should be marked as excluded.
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. 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. Alternatively, restarting your machine will have the same effect as restarting the TSM scheduler.
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.

















