Selective

The selective command backs up files that you specify. If you damage or mislay these files, you can replace them with backup versions from the server.

When you run a selective backup, all the files are candidates for backup unless you exclude them from backup, or they do not meet management class requirements for serialization.

During a selective backup, copies of the files are sent to the server even if they did not change since the last backup - which can result in more than one copy of the same file on the server. If this occurs, you might not have as many different down-level versions of the file on the server as you intended. Your version limit might consist of identical files. To avoid this, use the incremental command to back up only new and changed files.

Windows operating systemsLinux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systemsYou can selectively back up single files or directories. You can also use wildcard characters to back up groups of related files.

If you set the subdir option to yes when you back up a specific path and file, the client recursively backs up all subdirectories under that path, and any instances of the specified file that exist under any of those subdirectories.

During a selective backup, a directory path might be backed up, even if the specific file that was targeted for backup is not found. For example, the following command still backs up dir1 and dir2 even if the file bogus.txt does not exist.

Mac OS X operating
systems
   selective /Users/user1/Documents/dir1/bogus.txt
Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systems
   selective "/dir1/dir2/bogus.txt"
Windows operating systems
   selective c:\dir1\dir2\bogus.txt

If the selective command is retried because of a communication failure or session loss, the transfer statistics displays the number of bytes that the client attempts to transfer during all command attempts. Therefore, the statistics for bytes transferred might not match the file statistics, such as those for file size.

Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systemsYou can use the removeoperandlimit option to specify that the 20-operand limit is removed. If you specify the removeoperandlimit option with the selective command, the 20-operand limit is not enforced and is restricted only by available resources or other operating system limits.

Windows operating systemsLinux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systems

Supported Clients

This command is valid for all clients.

Syntax

Read syntax diagramSkip visual syntax diagramSelective filespec options

Parameters

filespec
Specifies the path and name of the file you want to back up. Use wildcard characters to include a group of files or to include all files in a directory.
To include multiple file specifications, separate each filespec with a space character. If multiple file specifications are included, and two or more of the specifications have common parent directories, then it is possible for the common directory objects to be backed up more than once. The conditions under which this behavior occurs are runtime-dependent, but the behavior itself has no adverse effects.

Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systemsFor example, if the filespec is /home/amr/ice.doc /home/amr/fire.doc, then /home and /home/amr might be backed up twice. The file objects, ice.doc and fire.doc, are backed up only once.

Windows operating systemsFor example if the filespec is C:\proposals\drafts\ice.doc C:\proposals\drafts\fire.doc, then C:\proposals and C:\proposals\drafts might be backed up twice. The file objects ice.doc and fire.doc are backed up only once.

If you want to avoid including the shared parent directory more than once, use separate, non-overlapping selective commands to back up each file specification.
Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systemsIf you back up a file system, include a trailing slash (/home/).
Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systemsThere is a limit of 20 operands. This limit prevents excessive sessions that are caused when wildcards are expanded by the UNIX shell command processor. You can prevent shell expansion from causing you to go over the 20-operand limit by placing quotation marks around file specifications that contain wildcards ("home/docs/*").
Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systemsYou can use the removeoperandlimit option to specify that the 20-operand limit is removed. If you specify the removeoperandlimit option, the 20-operand limit is not enforced and is restricted only by available resources or other operating system limits. For example, remove the 20 operand limit to backup 21 file specifications:
selective -removeoperandlimit filespec1 filespec2 ... filespec21
Windows operating systemsIf you back up a file system, include a trailing slash (C:\).
Windows operating systemsYou can specify as many file specifications as available resources or other operating system limits allow.
You can use the filelist option, instead of file specifications, to identify which files to include in this operation. However, these two methods are mutually exclusive. You cannot include file specification parameters and use the filelist option. If the filelist option is specified, any file specifications that are included are ignored.
Table 1. Selective command: Related options
Option Where to use
Windows operating systemschangingretries Windows operating systemsClient options file (dsm.opt) or command line.
Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systemschangingretries Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systemsClient system options file (dsm.sys) or command line.
Windows operating systemscompressalways Windows operating systemsClient options file (dsm.opt) or command line.
Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systemscompressalways Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systemsClient user options file (dsm.opt) or command line.
Windows operating systemscompression Windows operating systemsClient options file (dsm.opt) or command line.
Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systemscompression Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systemsClient user options file (dsm.opt) or command line.
dirsonly Command line only.
filelist Command line only.
filesonly Command line only.
Windows operating systemspostsnapshotcmd Windows operating systemsClient options file (dsm.opt) or with the include.fs option.
Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systemspreservelastaccessdate Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systemsClient user options file (dsm.opt) or command line.
Windows operating systemspreservelastaccessdate Windows operating systemsClient options file (dsm.opt) or command line.
Windows operating systemspresnapshotcmd Windows operating systemsClient options file (dsm.opt) or with the include.fs option.
Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systemsremoveoperandlimit Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systemsCommand line only.
Windows operating systemsskipntpermissions Windows operating systemsClient options file (dsm.opt) or command line.
Windows operating systemsskipntsecuritycrc Windows operating systemsClient options file (dsm.opt) or command line.
Linux operating systemsAIX operating systemssnapshotcachesize Linux operating systemsAIX operating systemsClient options file (dsm.opt) or with the include.fs option.
AIX operating systemssnapshotproviderfs AIX operating systemsSystem-options file (dsm.sys) within a server stanza or with the include.fs option.
Windows operating systemssnapshotproviderfs Windows operating systemsClient options file (dsm.opt) or with the include.fs option.
Windows operating systemsLinux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systemssnapshotroot Windows operating systemsLinux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systemsCommand line only.
Windows operating systemssubdir Windows operating systemsClient options file (dsm.opt) or command line.
Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systemssubdir Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systemsClient user options file (dsm.opt) or command line.
Windows operating systemstapeprompt Windows operating systemsClient options file (dsm.opt) or command line.
Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systemstapeprompt Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systemsClient user options file (dsm.opt) or command line.

Examples

Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systemsTask
Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systemsBack up the proja file in the /home/devel directory.

Command: selective /home/devel/proja

Windows operating systemsTask
Windows operating systemsBack up the proja.dev file in the c:\devel directory.

Command: sel c:\devel\proja.dev

Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systemsTask
Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systemsBack up all files in the /home/devel directory whose file names begin with proj.

Command: selective "/home/devel/proj*"

Windows operating systemsTask
Windows operating systemsBack up all files in the c:\devel directory whose file names begin with proj.

Command: sel c:\devel\proj*.*

Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systemsTask
Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systemsBack up all files in the /home/devel directory whose file names begin with proj. Back up the single file that is named budget in the /user/home directory.

Command: selective "/home/devel/proj*" /user/home/budget

Windows operating systemsTask
Windows operating systemsBack up all files in the c:\devel directory whose file names begin with proj. Back up all files with a file extension of .fin in the c:\planning directory.

Command: sel c:\devel\proj* c:\planning\*.fin

Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systemsTask
Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systemsBack up the /home file system.

Command: selective /home/ -subdir=yes

Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systemsTask
Linux operating systemsOracle Solaris operating
systemsAIX operating systemsMac OS X operating
systemsAssuming that you initiated a snapshot of the /usr file system and mounted the snapshot as /snapshot/day1, run a selective backup of the /usr/dir1/sub1 directory tree from the local snapshot and manage it on the IBM® Storage Protect server under the file space name /usr.

Command: dsmc sel "/usr/dir1/sub1/*" -subdir=yes -snapshotroot=/snapshot/day1

Windows operating systemsTask
Windows operating systemsAssuming that you initiated a snapshot of the C:\ drive and mounted the snapshot as \\florence\c$\snapshots\snapshot.0, run a selective backup of the c:\dir1\sub1 directory tree from the local snapshot and manage it on the IBM Storage Protect server under the file space name C:\.

Command: dsmc sel c:\dir1\sub1\* -subdir=yes -snapshotroot=\\florence\c$\snapshots\snapshot.0