AIX operating systemsHP-UX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systemsWindows operating systems

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.

Return code handling and scheduled action behavior depends on both the option specified, and the type of operation that is scheduled:
  • 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 Tivoli® Storage Manager client API does not support this option. The server can also define this option.

Options File

AIX operating systemsHP-UX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systemsPlace this option in the dsm.sys file 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.

Windows operating systemsPlace 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

Read syntax diagramSkip visual syntax diagram
>>-+-POSTSChedulecmd--+-- --cmdstring--------------------------><
   '-POSTNSChedulecmd-'                 

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.

AIX operating systemsHP-UX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systemsIf 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.

Windows operating systemsSpecify 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 Tivoli Storage Manager 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.

Mac OS X operating systemsFor Mac OS X, if the postschedulecmd schedule command is a UNIX shell script, enter the name of the script to run. For example, if the file presched.sh is a UNIX shell script, enter this command:
   postschedulecmd "/Volumes/La Pomme/Scripting/presched.sh"

Examples

Mac OS X operating systemsOptions file:
Mac OS X operating systemspostschedulecmd "/Volumes/La Pomme/Scripting/postsched.sh"
AIX operating systemsHP-UX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systemsOptions file:
AIX operating systemsHP-UX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systemspostschedulecmd "restart database"

The command string is a valid command for restarting your database.

Windows operating systemsOptions file:
Windows operating systems

posts startdb.cmd
posts 'rename c:\myapp\logfile.log logfile.new'
posts 'net start "simple service"'
posts 'rename "c:\myapp\log file.log" "log file.new"'
posts '"C:\Program Files\MyTools\runreport.bat"
  log1.in log2.in'

Mac OS X operating systemsCommand line:
Mac OS X operating systems-postschedulecmd="/Volumes/La Pomme/Scripting/postsched.sh"
AIX operating systemsHP-UX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systemsWindows operating systemsCommand line:
AIX operating systemsHP-UX operating systemsLinux operating systemsOracle Solaris operating systemsMac OS X operating systemsWindows operating systems-postschedulecmd="'restart database'"

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