AIX operating systemsLinux operating systemsWindows operating systems

Presnapshotcmd

The presnapshotcmd option allows you to run operating system commands before the backup-archive client starts a snapshot.

This allows you to quiesce an application before the client starts the snapshot during a snapshot-based backup or archive.

Windows operating systemsThis option can be used in conjunction with the postsnapshotcmd option to allow you to quiesce an application while a snapshot is created, and then to restart that application after the snapshot is started. This option is only valid if OFS or online image backup has been configured.

AIX operating systemsAIX® only: This option is only applicable to JFS2 snapshot-based file backup or archive and snapshot-based image backup. For a snapshot-based file backup or archive, use this option with the backup command, the include.fs option, or in the dsm.sys file.

Linux operating systemsLinux only: This option is only valid if the LVM is installed and configured on your system, allowing you to perform a snapshot-based image backup.

AIX operating systemsLinux operating systemsAIX and Linux only: For a snapshot-based image backup, use this option with the backup image command, the include.image option, or in the dsm.sys file.

Windows operating systemsFor an online image backup, use this option with the backup image command, the include.image option, or in the dsm.opt file.

Windows operating systemsFor open file support operations, use the presnapshotcmd option in an include.fs statement or in your client options file (dsm.opt).

If the presnapshotcmd fails it is assumed that the application is not in a consistent state and the client stops the operation and display the appropriate error message.

Windows operating systemsAttention: During image backup operations or snapshot differential backup operations, if the command that you include on either the presnapshotcmd or postsnapshotcmd statement starts an asynchronous process, the command might not complete before the backup operation finishes. If the command does not complete before the backup completes, temporary files might be locked, which prevents them from being deleted. A database event occurs and the following message is recorded in the dsmerror.log file:
ANS0361I DIAG: ..\..\common\db\cacheobj.cpp( 777): dbDelete(): 
 remove('C:\adsm.sys\SystemExcludeCache__24400820.TsmCacheDB'): 
  errno 13: "Permission denied".

The file that is specified in the message (cacheobj.cpp) can be manually deleted after the command that was started by the presnapshotcmd or postsnapshotcmd option completes.

Supported Clients

AIX operating systemsLinux operating systemsThis option is valid for AIX JFS2 and Linux x86_64 clients only. The IBM Spectrum Protect™ API does not support this option. The server can also define this option.

Windows operating systemsThis option is valid for all Windows clients. The IBM Spectrum Protect API does not support this option. The server can also define this option.

Options File

AIX operating systemsLinux operating systemsPlace this option in the client system-options file (dsm.sys) within a server stanza. You can set also this option on the Image-Snapshot tab of the Preferences editor.

Windows operating systemsPlace this option in the client options file (dsm.opt). You can set also this option on the Image-Snapshot tab of the Preferences editor.

Syntax

Read syntax diagramSkip visual syntax diagram
>>---PRESNAPshotcmd---- --"cmdstring"--------------------------><

Parameters

AIX operating systemsLinux operating systems"cmdstring"
AIX operating systemsLinux operating systemsSpecifies a command to process.

Use the srvprepostsnapdisabled option to prevent the IBM Spectrum Protect server administrator from running operating system commands on the client system.

If the command string contains blanks, enclose the command string in quotation marks:
   "quiesce database myDb"
If you placed quotation marks within the command string, then enclose the entire command string in single quotation marks:
   'resume database "myDb"'
Windows operating systems"cmdstring"
Windows operating systemsSpecifies the quiesce command to process.

Use a blank, or null, string for "cmdstring" if you want to prevent any commands from running that the administrator uses for presnapshotcmd. If you specify a blank or null string, it prevents the administrator from using a command on this option. If your administrator uses a blank or null string on the presnapshotcmd option, you cannot run a pre-snapshot command.

Use the srvprepostsnapdisabled option to prevent the IBM Spectrum Protect server administrator from running operating system commands on the client system.

If the command string contains blanks, enclose the command string in quotation marks:
   "quiesce database myDb"
If you placed quotation marks within the command string, then enclose the entire command string in single quotation marks:
   'resume database "myDb"'

Examples

AIX operating systemsLinux operating systemsOptions file:
AIX operating systemsLinux operating systems

presnapshotcmd "any shell command or script"

Windows operating systemsOptions file:
Windows operating systems

presnapshotcmd "<insert your application quiesce command here>
  application"

The command string is a valid command for quiescing your application.

AIX operating systemsLinux operating systemsCommand line:
AIX operating systemsLinux operating systems
backup image -presnapshotcmd="any shell command or script"
Windows operating systemsCommand line:
Windows operating systems
backup image -presnapshotcmd="<insert your application quiesce command 
  here> application"

This option is valid only on the initial command line. It is not valid in interactive mode.