Postschedulecmd/Postnschedulecmd
The postschedulecmd/postnschedulecmd option specifies a command that the client program processes after it runs a schedule.
If you want the client program to wait for the command to complete before it continues with other processing, use the postschedulecmd option. If you do not want to wait for the command to complete before the client continues with other processing, specify the postnschedulecmd option.
- For scheduled operations where the scheduled action is something other than COMMAND:
If the postschedulecmd command does not complete with return code 0 (zero), the return code for the scheduled event is either 8, or the return code of the scheduled operation, whichever is greater. If you do not want the postschedulecmd command to be governed by this rule, you can create a script or batch file that starts the command and exits with return code 0. Then configure postschedulecmd to start the script or batch file.
- For scheduled operations where the scheduled action is COMMAND:
The return code from the command specified on the postschedulecmd option does not affect the return code that is reported to the server when the scheduled event completes. If you want the results of postschedulecmd operations to affect the return code of the scheduled event, include the postschedulecmd operations in the scheduled action command script instead of using the postschedulecmd option.
- If the scheduler action cannot be started, and the command specified on the preschedulecmd option completes with a return code of zero (0), the command specified by the postschedulecmd option is run.
- The return code from an operation specified on the postnschedulecmd option is not tracked, and does not influence the return code of the scheduled event.
Supported Clients
This option is valid for all clients. The IBM Spectrum Protect API does not support this option. The server can also define this option.
Options File
Place this option in the client system-options file (dsm.sys) within a server stanza. You can set this option on the Scheduler tab in the Schedule Command text box in the Preferences editor. The server can also define these options.
Place this option in the client options file (dsm.opt). You can set this option on the Scheduler tab in the Schedule Command text box in the Preferences editor. The server can also define these options.
Syntax
Parameters
- cmdstring
- Specifies the command to process. You can enter a command to be run after a schedule with this
option. Use only one postschedulecmd option.
If the command string contains blanks, enclose the command string in quotation marks. If you placed quotation marks within the command string, then enclose the entire command string in single quotation marks.
Specify the command string just as you would enter it from the operating system command prompt. If the command string contains any blank spaces, enclose the command string in single quotation marks. For example:'net stop someservice'
Use a blank, or null, string for cmdstring if you want to prevent any commands from running that the IBM Spectrum Protect server administrator uses for postschedulecmd or preschedulecmd. If you specify a blank or null string on either option, it prevents the administrator from using a command on both options.
If your administrator uses a blank or null string on the postschedulecmd option, you cannot run a post-schedule command.
For Mac OS X, if the postschedulecmd schedule command is an AppleScript, you must use the osascript command to run the script. For example, ifDatabase Script
is an AppleScript, enter this command:postschedulecmd osascript "/Volumes/La Pomme/Scripting/ Database Script"
Examples
- Options file:
- For Mac OS X:
postschedulecmd "/Volumes/La Pomme/Scripting/postsched.sh"
- Options file:
postschedulecmd "restart database"
The command string is a valid command for restarting your database.
- Options file:
-
postsc startdb.cmd
postsc 'rename c:\myapp\logfile.log logfile.new'
postsc 'net start "simple service"'
postsc 'rename "c:\myapp\log file.log" "log file.new"'
postsc '"C:\Program Files\MyTools\runreport.bat"
log1.in log2.in' - Command line:
-postschedulecmd="/Volumes/La Pomme/Scripting/postsched.sh"
- Command line:
-postschedulecmd="'restart database'"
This option is valid only on the initial command line. It is not valid in interactive mode.