Excluding files with the EXCLUDE.DIR statement

The EXCLUDE.DIR statement excludes all directories and files under the parent directory.

If you want to include all files that match a file pattern, regardless of their location within a directory structure, do not use EXCLUDE.DIR statements.

For example, consider this set of include-exclude statements:

AIX operating systemsLinux operating systemsMac OS X operating systems
exclude.dir /usr
include /.../*.o
Windows operating systems
exclude.dir C:\Users
include C:\...\*.o

The INCLUDE statement in this example indicates that all files with a .o extension are included, but the preceding EXCLUDE.DIR statement excludes all files in the /usr or C:\Users directory, even if they have a .o extension. This fact would be true, regardless of the order of the two statements.

If you want to back up all the files that end with .o, use the following syntax:

AIX operating systemsLinux operating systemsMac OS X operating systems
exclude /usr/.../*
include /.../*.o
Windows operating systems
exclude C:\Users\...\*
include C:\...\*.o

When you use wildcards in include-exclude statements, use * if you want to include or exclude all the files, rather than the *.*.*.* pattern. The *.*.*.* pattern means to include or exclude all files that contain at least one dot (.) character, while * means to include or exclude all files. If you use *.*, files that contain no dot characters (such as C:\MYDIR\MYFILE on Windows) are not filtered.

If you want to run a selective backup, or a partial incremental backup, of a single file from the command-line client, it is not affected by the EXCLUDE.DIR option.

If you use the command-line client to start a selective backup, or a partial incremental backup, of a single file, the file is processed, even if there is an EXCLUDE.DIR statement that excludes one of the parent directories in the file path.

For example, consider the following include-exclude statement that is used in subsequent command-line actions:

AIX operating systemsLinux operating systemsMac OS X operating systems
exclude.dir /home/spike
Windows operating systems
exclude.dir C:\Users\spike

The following selective backup always results in the file being processed:

AIX operating systemsLinux operating systemsMac OS X operating systems
dsmc selective /home/spike/my.file
Windows operating systems
dsmc selective C:\Users\spike\my.file

If you issue a selective backup command that contains a wildcard, no files are processed because the directory is excluded:

AIX operating systemsLinux operating systemsMac OS X operating systems
dsmc selective "/home/spike/my.*"
Windows operating systems
dsmc selective "C:\Users\spike\my.*"
Important: A subsequent incremental backup of the /home file system renders inactive the /home/spike/my.file file. Likewise, on Windows, a subsequent incremental backup of the C:\Users directory renders inactive the C:\Users\spike\my.file file.
Do not end EXCLUDE.DIR statements with a directory delimiter.

The following examples show incorrect EXCLUDE.DIR statements, due to a directory delimiter at the end of the directory path:

AIX operating systemsLinux operating systems
exclude.dir /usr/
Mac OS X operating systems
exclude.dir /Users/
Windows operating systems
exclude.dir c:\directory\

The following examples show the correct coding of EXCLUDE.DIR:

AIX operating systemsLinux operating systems
exclude.dir /usr
Mac OS X operating systems
exclude.dir /Users
Windows operating systems
exclude.dir c:\directory