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.

Mac OS X operating systemsAIX operating systemsLinux operating systemsOracle Solaris 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

AIX operating systemsLinux operating systemsOracle Solaris 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
AIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systemsExclude all files that end with .doc, except those found in the home directory of aleko, Documents directory. AIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systems
EXCLUDE /.../*.doc
INCLUDE "/home/aleko/Documents/
  *.doc"
AIX operating systemsLinux operating systemsOracle Solaris 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. AIX operating systemsLinux operating systemsOracle Solaris 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
AIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systemsExclude all files and directories under any Documents directory that might exist, except for the Current file of user aleko. AIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systems
EXCLUDE /.../Documents/.../*
INCLUDE "/home/aleko/Documents/
  Current"
AIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systemsExclude all files in any directory named "tmp" and its subdirectories, except for the file /home/tmp/save.fil. AIX operating systemsLinux operating systemsOracle Solaris 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
Mac OS X operating systemsAIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systemsExclude any .cpp file in any directory on the Vol1, Vol2, Vol3, and Vol4 volumes. Mac OS X operating systemsAIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systems
EXCLUDE /Volumes/Vol[1-4]/.../*.cpp
Mac OS X operating systemsExclude any .cpp file in any directory on the Vol1, Vol2, Vol3, and Vol4 volumes. Mac OS X operating systems
EXCLUDE /Volumes/Vol[1-4]/.../*.cpp
AIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systemsExclude any .cpp file in any directory on the /fs1, /fs2, /fs3 and /fs4 file systems. AIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systems
EXCLUDE /fs[1-4]/.../*.cpp
AIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systemsExclude the .cpp files found in the /fs2/source directory. AIX operating systemsLinux operating systemsOracle Solaris 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.

AIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systemsExclude any .o file in any directory on the /usr1, /usr2, and /usr3 file systems. AIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systems
exclude /usr[1-3]/.../*.o  
AIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systemsExclude the .o files found in the root directory in the usr2 file system only. AIX operating systemsLinux operating systemsOracle Solaris 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
AIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systemsExclude any file that resides under the tmp directory found in any file system. AIX operating systemsLinux operating systemsOracle Solaris 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\...\*
AIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systemsExclude the entire directory structure /var/spool from all processing. AIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systems
exclude.dir /var/spool
AIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systemsExclude a single file system from backup processing. AIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systems
exclude.fs /fs1
exclude.fs home:
AIX operating systemsLinux operating systemsOracle Solaris 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. AIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systems
exclude.fs /test/myfs/fs01/.../*
exclude.fs /test/myfs/fs02/*
AIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systemsExclude the /home/mydir/test1 directory and any files and subdirectories under it. AIX operating systemsLinux operating systemsOracle Solaris 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
AIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systemsExclude all directories under the /home/mydir directory with names beginning with test. AIX operating systemsLinux operating systemsOracle Solaris 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*
AIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systemsExclude all directories directly under the /mydir directory with names beginning with test, on any file system. AIX operating systemsLinux operating systemsOracle Solaris 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*
AIX operating systemsLinux operating systemsOracle Solaris operating systemsExclude the raw logical volume from image backup. AIX operating systemsLinux operating systemsOracle Solaris operating systems
exclude.image /dev/hd0 
Windows operating systemsExclude the raw logical volume from image backup. Windows operating systems
exclude.image c:\*
AIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X 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. AIX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X 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]:\...\*