This chapter applies to the Authorized User only. Root authorization is only required when updating the /etc/inittab and /etc/rc files.
Your administrator can schedule Tivoli Storage Manager to perform tasks automatically on a regular basis. For example, you can automatically back up files at the end of each day or archive some of your files every Friday. This procedure, known as central scheduling, is a cooperative effort between the server and your client node. Your administrator associates clients with one or more schedules that are part of the policy domain maintained in the server database. The administrator defines central scheduling on the server and you start the client scheduler on your workstation. Once you start the client scheduler, further intervention is not necessary.
With client scheduling, you can also:
Notes:
You can modify scheduling options in the client system options file dsm.sys or in the graphical user interface. However, if your administrator specifies a value for these options, that value overrides the value in your client.
For more information about scheduling options, changing the scheduling mode, specifying the TCP/IP address or port number, or running commands before or after a schedule, see "Scheduling Options".
If you use Tivoli Storage Manager commands in shell scripts or executables, be aware that the return code from a Tivoli Storage Manager executable does not indicate a successful backup, archive, or restore of specific objects. The return code only indicates whether the Tivoli Storage Manager executable (e.g., dsmc or dsmserv) ran successfully during execution. The return code does not indicate whether a specific Tivoli Storage Manager command executed successfully inside of the Tivoli Storage Manager shell. The client returns a code greater than 0 (zero) only if Tivoli Storage Manager was unable to attempt the operation or if you cancel the operation.
For example, assume that your executable or shell script includes the Tivoli Storage Manager command:
dsmc sel myfile.txt
If Tivoli Storage Manager attempts to back up myfile.txt, and the dsmc command successfully starts and finishes, Tivoli Storage Manager sends a return code of 0. Tivoli Storage Manager returns 0 even if the file is not successfully processed for the following reasons:
Note: Only those return codes output to the Tivoli Storage Manager screen, activity log, schedule log, and error report indicate the success or failure of specific commands.
The Tivoli Storage Manager Client Acceptor daemon can manage the scheduler, reducing the number of background processes on your workstation. This also resolves memory retention problems that may occur when using traditional methods of running the scheduler.
Use the managedservices option in your client system options file to specify whether the Client Acceptor daemon manages the scheduler. See Managedservices for more information.
Perform the following steps to configure the CAD to manage the client scheduler:
To start the client scheduler on your client node and connect to the server schedule, change to the Tivoli Storage Manager installation directory and enter the following command:
dsmc schedule
When you start the client scheduler, it runs continuously until you close the window, end the process, or log off your system.
To run the schedule command in the background and to keep the client scheduler running, even if you log off your system, enter the following:
nohup dsmc schedule 2> /dev/null &
If a Tivoli Storage Manager password is required for your workstation and you want to run the schedule command in the background, enter the password with the command.
Root User: To start the client scheduler automatically, ensure that the passwordaccess option is set to generate in your client system options file (dsm.sys), then follow the procedure below for your operating system:
tsm::once:/usr/bin/dsmc sched > /dev/null 2>&1 # TSM scheduler
cd /usr/lpp/Tivoli/tsm/client/ba/bin sleep 60 ./dsmc scheduleThis prevents the creation of two jobs with the same name and enables automatic shutdown. You may need to customize the time for your system. Refer to the user's manual for complete client scheduler instructions.
# Set environment variables to retrieve the servername and # nodename options from dsm.sys. export DSM_DIR=/tivoli/tsm/client/ba/bin export DSM_CONFIG=/tivoli/tsm/client/ba/bin/dsm.opt # Start the TSM Client scheduler and redirect outputs to # schedule.out instead of the /etc/log file. _BPX_JOBNAME='ADSMCLNT' /tivoli/tsm/client/ba/bin/rundsmc 1>/tivoli/tsm/client/ba/bin/schedule.out 2>&1 &
The client scheduler may fail to initialize properly at IPL because TCP/IP is not fully initialized. You may need to customize the time for your system to compensate for this.
Tivoli Storage Manager does not recognize changes made to the dsm.opt or the dsm.sys file while the client scheduler is running. If you make changes to these files while the client scheduler is running, and you want to use the new values immediately, stop the client scheduler and restart it. For example, if you change the inclexcl option in your dsm.sys file to point to a different include-exclude options file, you must stop the client scheduler and restart it before Tivoli Storage Manager uses the new file.
To manually stop the client scheduler, enter the kill command if it is running in the background, or press q or Ctrl+C if it is running in the foreground. To restart the client scheduler, enter the schedule command again.
Tape prompting does not occur during a scheduled event regardless of the tapeprompt option setting in your options file.
Use the Client Acceptor daemon to manage the Client Scheduler. See "Managing the Client Scheduler Using the Client Acceptor Daemon" for more information.
To view schedules that are defined for your client node, enter:
dsmc query schedule
Tivoli Storage Manager displays detailed information about all scheduled work for your client node. The figure below displays sample query schedule output.
Figure 1. Sample Query Schedule Output
Schedule Name: DAILY_INC Description: Daily System-wide backup Action: Incremental Options: QUIET Objects: Priority: 1 Next Execution: 30 minutes Duration: 4 Hours Period: 1 Day Day of Week: Any Expire: Never Schedule Name: WEEKLY_INC Description: Weekly backup for project files Action: Incremental Options: QUIET Objects: /proj Priority: 1 Next Execution: 60 minutes Duration: 8 Hours Period: 7 Days Day of Week: Friday Expire: Never |
The schedule name, DAILY_INC, starts a daily incremental backup. The next incremental backup will start in 30 minutes. Because no objects are listed, Tivoli Storage Manager runs the incremental backup on your default domain. The schedule has no expiration date.
The schedule name, WEEKLY_INC, starts a weekly incremental backup in the /proj file system.
When you run the schedule command in the foreground, your screen displays output from the scheduled commands. Output is also directed to the dsmsched.log file in the current directory unless you change the path and file name using the schedlogname option.
When you run the schedule command in the background, output from scheduled commands is directed to the dsmsched.log file in the current directory, or to the path and file name that you specified. Please note that the dsmsched.log cannot be a symbolic link.
After scheduled work is performed, check the schedule log to verify that all work completed successfully.
When a scheduled command is processed the schedule log may contain the following entry:
Scheduled event eventname completed successfully
The client indicates whether Tivoli Storage Manager successfully issued the scheduled command associated with the eventname. No attempt is made to determine the success or failure of the command. You can assess the status of the command by evaluating the return code from the scheduled command in the schedule log. The schedule log entry for the command's return code is prefaced with the following text:
Finished command. Return code is:
The schedule log continues to grow unless you prune it using the schedlogretention option. See "Specifying Scheduling Options" for more information.
The scheduler executes commands under a user ID of 0; however, some commands may need to be executed under a user ID different than 0. In this case, your Tivoli Storage Manager administrator can define schedules for commands that will be executed under a user ID different from the scheduler user ID using the schedcmduser server option.
The schedcmduser option specifies the name of a valid user on the system where a scheduled command is executed. If this option is specified, the command is executed with the authorization of the specified user. Otherwise, it is executed with the scheduler authorization. This option is valid for UNIX clients only.
>>-SCHEDCMDUser---user_name------------------------------------><
You can query the schedules defined by your Tivoli Storage Manager administrator by entering the following command:
query schedule
You can use the schedcmddisabled option to disable the scheduling of commands by the server. Commands are scheduled by using the action=command option on the define schedule server command.
The schedcmddisabled option does not disable the preschedulecmd and postschedulecmd commands. However, you can specify preschedulecmd or postschedulecmd with a blank or a null string to disable the scheduling of these commands. See Schedcmddisabled for more information.