Examples using wildcards with include and exclude patterns

The backup-archive client accepts the exclude.dir option, which can be used to exclude directory entries. However, the include and exclude.dir options cannot be used together.

Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systemsNote: In the dsm.sys file, the include and exclude options do not work with symbolic links to directories. For example, do not use /u in your include or exclude statements because /u is a symbolic link to the /home directory. Instead of entering:
   include /u/tmp/save.fil
enter:
   include /home/tmp/save.fil

Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systemsHowever, the exclude option does work with symbolic links to directories when you enter a backup command with the absolute path that contains the symbolic link.

Table 1 shows how to use wildcard characters to include or exclude files.

Table 1. Using wildcard characters with include and exclude patterns
Task Pattern
Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systemsExclude all files that end with .doc, except those found in the home directory of aleko, Documents directory. Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systems
EXCLUDE /.../*.doc
INCLUDE /home/aleko/Documents/*.doc
Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systemsExclude all files during backup with an extension of bak, except those found on the /usr file system in the dev directory. Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systems
exclude /.../*.bak
include /usr/dev/*.bak      
Windows operating systemsExclude all files during backup with an extension of bak, except those found on the d: drive in the dev directory. Windows operating systems
exclude ?:\*.bak
include d:\dev\*.bak
Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systemsExclude all files in any directory named tmp and its subdirectories, except for the file /home/tmp/save.fil. Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systems
exclude /.../tmp/.../*
include /home/tmp/save.fil
Windows operating systemsExclude all files in any directory named tmp and its subdirectories, except for the file d:\tmp\save.fil. Windows operating systems
exclude ?:\...\tmp\...\*
include d:\tmp\save.fil
Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systemsExclude any .cpp file in any directory on the Vol1, Vol2, Vol3, and Vol4 volumes. Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systems
EXCLUDE /Volumes/Vol[1-4]/.../*.cpp
Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systemsExclude any .cpp file in any directory on the /fs1, /fs2, /fs3 and /fs4 file systems. Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systems
EXCLUDE /fs[1-4]/.../*.cpp
Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systemsExclude the .cpp files found in the /fs2/source directory. Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systems
EXCLUDE /fs2/source/*.cpp
Windows operating systemsExclude any .obj file for backup in any directory on the c: e: f: and g: drives. Windows operating systems
exclude [ce-g]:\...\*.obj  

The c: e: f: and g: drives are local or removable.

Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systemsExclude any .o file in any directory on the /usr1, /usr2, and /usr3 file systems. Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systems
exclude /usr[1-3]/.../*.o  
Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systemsExclude the .o files found in the root directory in the usr2 file system only. Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systems
exclude /usr2/*.o
Windows operating systemsExclude the .obj files found in the root directory in the d: drive only. Windows operating systems
exclude d:\*.obj
Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systemsExclude any file that resides under the tmp directory found in any file system. Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systems
exclude /.../tmp/.../*
Windows operating systemsExclude any file that resides under the tmp directory found on any drive. Windows operating systems
exclude ?:\tmp\...\*
Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systemsExclude the entire directory structure /var/spool from all processing. Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systems
exclude.dir /var/spool
Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systemsExclude a single file system from backup processing. Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systems
exclude.fs /fs1
exclude.fs home:
Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systemsExclude all file systems mounted anywhere in the /test/myfs/fs01 and /test/myfs/fs02 directory tree from backup processing. Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systems
exclude.fs /test/myfs/fs01/.../*
exclude.fs /test/myfs/fs02/*
Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systemsExclude the /home/mydir/test1 directory and any files and subdirectories under it. Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systems
exclude.dir /home/mydir/test1
Windows operating systemsExclude the c:\mydir\test1 directory and any files and subdirectories under it. Windows operating systems
exclude.dir c:\mydir\test1
Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systemsExclude all directories under the /home/mydir directory with names beginning with test. Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systems
exclude.dir /home/mydir/test*
Windows operating systemsExclude all directories under the \mydir directory with names beginning with test. Windows operating systems
exclude.dir c:\mydir\test*
Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systemsExclude all directories directly under the /mydir directory with names beginning with test, on any file system. Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systems
exclude.dir /.../mydir/test*
Windows operating systemsExclude all directories directly under the \mydir directory with names beginning with test, on any drive. Windows operating systems
exclude.dir ?:\mydir\test*
Linux operating systemsOracle Solaris operating
systemsAIX operating systemsExclude the raw logical volume from image backup. Linux operating systemsOracle Solaris operating
systemsAIX operating systems
exclude.image /dev/hd0 
Windows operating systemsExclude the raw logical volume from image backup. Windows operating systems
exclude.image c:\*
Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systemsExclude all symbolic links or aliases (aliases apply to Mac OS X) from backup processing, except for the Docs directory for user1. Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systems
EXCLUDE.ATTRIBUTE.SYMLINK /.../*
INCLUDE.ATTRIBUTE.SYMLINK /Users/user1/Docs/*
Windows operating systemsExclude all directories and files on the local drives, except the c: drive. Windows operating systems
exclude     [abd-z]:\...\*
exclude.dir [abd-z]:\...\*