What do you want to exclude from backup?
The IBM Spectrum Protect client comes with a set of default exclusions coded in the configuration file. While these default exclusions should not generally be modified or removed, they can be added to.
Warning: Spectrum Protect exclude rules cannot be used as a temporary means of excluding data from backup. If you add an exclude rule for files or folders, then those files or folders are immediately marked for deletion on the UBI server. If you at any time wish to back up those files or folders, you would need to resend all that you have previously excluded: it cannot be unexcluded or reintegrated into your backup without a fresh resend. Please use this facility only to permanently exclude data from backup.
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 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 want to see basic examples of different options available: see basic exclude examples.
Excluding files from backup
You can exclude files from backup either in the Spectrum Protect graphical user interface (GUI) or by editing the configuration file.
Excluding files from backup using the graphical user interface
- Run Spectrum Protect Backup-Archive GUI as Administrator or Root
- Click on Edit, then Client Preferences. The Preferences Editor window will appear, on the General Preferences section.
- From the list of tabs on the left, click on Include-Exclude. The list of current Include-Exclude Preferences will appear.
- Click on Add and the Define Include-Exclude Options window will appear. Under Category, select Backup, and under Type select Exclude.
- Under File or Pattern, click Browse, and browse to a file that you want to exclude and click OK.
- Click OK on the Define Include-Exclude Options window. The file will now be listed in the Include Exclude Preferences.
- 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
- Once your exclude rules are completed, click OK in the Preferences Editor. This will take you back to the main Spectrum Protect window.
- To verify that your new exclude rule(s) is/are working correctly. attempt to perform a manual backup of one or more of your excluded files. It should be marked with a barred red circle, and TSM will not permit you to back up any files or folders that are marked in this way.
- Lastly, if you use the automatic scheduled backups, you must now restart the 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 honored on the scheduled backups. Alternatively, restarting your machine will have the same effect as restarting the TSM scheduler.
Excluding files from backup by editing the configuration file
- Locate the configuration file: In Windows it is named dsm.opt, In Linux it is named dsm.sys. The location of the configuration file is platform-specific and can be looked up in our list of Options Files.
- In Windows, permissions to edit the contents of C:\Program Files are limited. We therefore recommend that run your text editor as administrator before using it to open dsm.opt.
- Now edit the TSM configuration file 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 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.
- Save the configuration file.
- To verify that your new exclude rule(s) is/are working correctly. attempt to perform a manual backup of one or more of your excluded files. It should be marked with a barred red circle, and UBI will not permit you to back up any files or folders that are marked in this way.
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 honored on the scheduled backups. Alternatively, restarting your machine will have the same effect as restarting the TSM scheduler.
Excluding folders from backup
You can exclude folders from backup either in the Spectrum Protect graphical user interface (GUI) or by editing the 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 mount point. If you wish to exclude e.g. E: (Windows), /Volumes/ExternalDrive, or /home where /home is a file system or mount point, please see instead excluding one or more drives or partitions.
Excluding files from backup using the graphical user interface
- Run Spectrum Protect Backup-Archive GUI as Administrator or Root
- Click on Edit, then Client Preferences. The Preferences Editor window will appear, on the General Preferences section.
- From the list of tabs on the left, click on Include-Exclude. The list of current Include-Exclude Preferences will appear.
- Click on Add and the Define Include-Exclude Options window will appear. Under Category select Backup, and under Type selectDir:
- Under File or Pattern, click Browse, and a window headed File 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 the Define 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
- Once your exclude rules are completed, click OKin the Define Include-Exclude Options window and then OK again in thePreferences Editor. This will take you back to the main TSM window.
- To verify that your new exclude rule(s) is/are working correctly. attempt to perform a manual backup of one or more of your excluded files. It should be marked with a barred red circle, and TSM will not permit you to back up any files or folders that are marked in this way.
- Lastly, if you use the automatic scheduled backups, you must now restart the 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 honored on the scheduled backups. Alternatively, restarting your machine will have the same effect as restarting the scheduler.
Excluding folders from backup by editing the TSM configuration file
- Locate the TSM configuration file: In Windows it is named dsm.opt, In Linux it is named dsm.sys. 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 move opt to the desktop before you open it for editing. Users of these versions of Windows should therefore browse toC:\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.)
- Now edit the 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 opt/dsm.sys. For example, to exclude folder C:\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.
- To verify that your new exclude rule(s) is/are working correctly. attempt to perform a manual backup of one or more of your excluded files. It should be marked with a barred red circle, and TSM will not permit you to back up any files or folders that are marked in this way.
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 honored on the scheduled backups. Alternatively, restarting your machine will have the same effect as restarting the TSM scheduler.
Excluding drives and partitions from backup
By default, Spectrum Protect 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 backup@psu.edu and indicate which drive’s backup you wish to be deleted.
You can exclude a drive or partition from backup either in the Spectrum Protect 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.
Excluding drives and partitions by changing the backup domain
UBI 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 honor the domain setting you have made in the graphical user interface and not back up drives which are not listed in the backup domain.)
Changing the backup domain using the graphical user interface
This is the simplest way to prevent a drive or partition being backed up during scheduled backups. To remove a drive or partition from the backup domain in the graphical user interface, do as follows:
- Run TSM Backup-Archive GUI as Administrator or Root
- Click on Edit, then Client Preferences. The Preferences Editor window will appear, on the General Preferences section.
- From the list of tabs on the left, click on Backup. The Backup Preferences window will appear.
- Under Domain for Backup, untick Back up all local file systems, and select those drives that you want to include for backup.
- Click OK.
- Now verify that the backup domain is now set correctly. The easiest way to do this is in the Spectrum Protect 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 honored on the scheduled backups. Alternatively, restarting your machine will have the same effect as restarting the scheduler.
Changing the backup domain by editing the Spectrum Protect configuration file
- Locate the Spectrum Protect configuration file: the backup domain is set in dsm.opt on 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, permissions to edit the contents of C:Program Filesare limited. We therefore recommend that you run your text editor as administrator before using it to open dsm.opt.
- Now edit the DOMAIN line of opt in a text editor. Please do not alter or remove any existing rules or other lines of dsm.opt. The default setting is:
DOMAIN ALL-LOCAL
To remove a drive from the backup domain, change the DOMAIN line to be the appropriate line below:
Windows – to back up only drive C: and E::
DOMAIN C: E:
Linux:
DOMAIN / /home
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:
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 Files to 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 Spectrum Protect 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 Spectrum Protect 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 honored on the scheduled backups. Alternatively, restarting your machine will have the same effect as restarting the Spectrum Protect scheduler.
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.
Excluding drives and partitions from backup with an exclude rule 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:
- Run TSM Backup-Archive GUI as Administrator or Root
- Click on Edit, then Client Preferences. The Preferences Editor window will appear, on the General Preferences section.
- From the list of tabs on the left, click on Include-Exclude. The list of current Include-Exclude Preferences will appear.
- Click on Add and the Define Include-Exclude Options window will appear. Under Category select Backup, and under Type select Exclude.
- Under File or Pattern, click Browse, and a window headed File or Pattern will 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 the Define Include-Exclude Options window.
- Now edit the File or Pattern field so that, after the drive name, it reads either \…\* (Windows) or /…/* (Linux). The example below is for excluding all of C: on Windows. So you will have a result that looks like one of:
Windows:
C:\…\*
Linux:
/scratch/…/*
A simpler alternative, available in Linux only, is to select the Type option Exclude.fs rather than Exclude. You can then browse to the file system to be excluded with the Browse button.
- Once your exclude rule is 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.
- To verify that your new exclude rule(s) is/are working correctly. attempt to perform a manual backup of one or more of your excluded files. It should be marked with a barred red circle, and TSM will not permit you to back up any files or folders that are marked in this way.
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 honored on the scheduled backups. Alternatively, restarting your machine will have the same effect as restarting the TSM scheduler.
Excluding drives and partitions from backup with an exclude rule by editing the configuration file
- Locate the TSM configuration file: In Windows it is named dsm.opt, In Linux it is named dsm.sys. The location of the configuration file is platform-specific and can be looked up in our list of TSM Options Files
- In Windows, permissions to edit the contents of C:\Program Files are limited. We therefore recommend that you move 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.)
- 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 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:\…\*
Linux:
Exclude /scratch/…/*
A alternative in Linux only is the option Exclude.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 Files to your desktop in order to edit it, now move it back.
- To verify that your new exclude rule(s) is/are working correctly. attempt to perform a manual backup of one or more of your excluded files. It should be marked with a barred red circle, and TSM will not permit you to back up any files or folders that are marked in this way.
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 honored on the scheduled backups. Alternatively, restarting your machine will have the same effect as restarting the TSM scheduler.
Excluding everything from backup except specific files or folders
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 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.
Excluding everything from backup except specific files or folders using the graphical user interface
- Run TSM Backup-Archive GUI as Administrator or Root
- Click on Edit, then Client Preferences. The Preferences Editor window will appear, on the General Preferences section.
- From the list of tabs on the left, click on Include-Exclude. The list of current Include-Exclude Preferences will appear.
- Click on Add and the Define Include-Exclude Options window will appear. Under Category select Backup, and under Type select Exclude.
- 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 or Linux:
Windows:
*:\…\*
Linux:
/…/*
- Enter the relevant text under File or Pattern and click OK, then again on Add so that the Define Include-Exclude Options window appears again. A second time, under Category select Backup, but under Type this time select Include (ignore the extra option that appears,Management Class).
- Under File or Pattern, click Browse, and a window headed File or Pattern will 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 the Define Include-Exclude Options window.
- Now edit the File or Pattern field so that, after the name of the folder that you wish to be included, it reads either \…\* (Windows) or/…/* (Linux).
- Click OK in the Define Include-Exclude Options This will take you back to the Preferences Editor. Under Include-Exclude Preferences, scroll down the Statement List and 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 the include rule is at the bottom. (If they are not, use the Move Up and/or Move Down buttons 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:
Exclude “*:\…\*”
Include “C:\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 OK again in the Preferences Editor. This will take you back to the main TSM window.
- To verify that your new exclude rule(s) is/are working correctly. attempt to perform a manual backup of one or more of your excluded files. It should be marked with a barred red circle, and TSM will not permit you to back up any files or folders that are marked in this way.
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 honored on the scheduled backups. Alternatively, restarting your machine will have the same effect as restarting the TSM scheduler.
Excluding everything from backup except specific files or folders by editing the TSM configuration file
- Locate the TSM configuration file: it is dsm.opt in Windows and dsm.sys in Linux. The location of the configuration file is platform-specific and can be looked up in our list of TSM Options Files.
- In Windows, permissions to edit the contents of C:\Program Files are limited. We therefore recommend that you run your text editor as administrator before using it to open dsm.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 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 the include rule 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 :
Exclude “*:\…\*”
Include “C:\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.
- To verify that your new exclude rule(s) is/are working correctly. attempt to perform a manual backup of one or more of your excluded files. It should be marked with a barred red circle, and TSM will not permit you to back up any files or folders that are marked in this way.
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 honored on the scheduled backups. Alternatively, restarting your machine will have the same effect as restarting the TSM scheduler.
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 Exclude or Include directive 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.DOC
then 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 Exclude directive 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 directive:
Exclude.dir C:\testdata
Note, however, that a perhaps unexpected outcome of this rule is that the names of the directory that is excluded will be sent to the TSM Server 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.dir directives 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.dat
then the file “summary.dat” will not be backed up even though the Include directive is below the Exclude.dir directive. The Exclude.dir directives 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 enter query inclexcl as below:
tsm> query inclexcl
The 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 ? The * matches any number of any character; the ? matches any single character. Thus to exclude any files whose names begin temp in the C:\tempdata folder use:
Exclude C:\tempdata\temp*
To exclude any files whose names begin with a variable single character then followed by _temp.dat in the C:\tempdata directory, use:
Exclude C:\tempdata\?_temp.dat
- To exclude numerous directories use the … Thus to exclude a directory called cacheand all its contents and sub-directories anywhere on drive C:, use:
Exclude.dir C:\…\cache
If, however, you have 100 directories called temp00, temp01, temp02 and so on up to temp99 on the 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 Exclude directive must follow the Include directive 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 C:\data directory.
If you use the automatic scheduled backups, you must now restart the Spectrum Protect 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 honored on the scheduled backups. Alternatively, restarting your machine will have the same effect as restarting the scheduler.