Creating scheduled tasks

You can schedule tasks for Copy Services Manager.

About this task

Starting with Copy Services Manager Version 6.2.1, you can use a GUI wizard to schedule tasks.

The scheduled tasks can consist of one or more actions, including issuing commands, and waiting for states.

The Wait for State action ensures that the next action in the list does not occur until the session is in the right state. The list of actions that you create in the wizard occur sequentially, one after the other. So the Wait for State action delays the next action in the task from running until the specified state is reached. The task fails if the state is not reached.

Perform the following steps to schedule a task:

Procedure

  1. Log in to the Copy Services Manager GUI as a user with administrator privileges.
  2. Click Settings > Scheduled Tasks.
  3. Click Create Task. The Scheduled Task wizard is displayed.
    1. Type a name for the scheduled task in the Task Name field.
    2. Optional: You can enter a Description for the scheduled task.
    3. You can also set the option to Create a PE package if error occurs running the task.
      Tip: The information in a PE package can be helpful when troubleshooting.
    4. Click Next.
  4. On the next page of the wizard, select whether you want the task to run Hourly or Daily/Weekly. You can also select No schedule if you do not want the task to run on a set schedule.
    Notes:
    • The task does not start running on the schedule until it is enabled.
    • If you select No schedule, you cannot enable the task because it does not have a schedule. You can run the task manually, but you must set a schedule to enable it.
    • If you select Hourly, indicate how often (for example, every 3 hours). The task is scheduled to start at the top of the hour at the selected interval.
      Note: The hourly scheduling is set by dividing a 24-hour day into the number of intervals that you want. For example, if wanted to run the task every 3 hours, that would equal eight times per day. In this example, starting at midnight, the day is divided into eight intervals.

      If you require a specific time of the day for the task to start, use the Daily/Weekly schedule.

    • If you select Daily/Weekly, select which day or days of the week, and a Time of day to start.
      Note: The start time is based on the browser, which uses the local system time. The Copy Services Manager server might not be located in the same time zone as the browser. Keep this fact in mind when you select the Time option.
    1. Click Next.
  5. Click Add Action.
  6. On the next page of the wizard, make the following selections:
    1. Choose the action Type from one of the following options:
      Command
      Runs a selected command on the selected session at the selected time interval. You select the command and session in a later step.
      Wait For State
      Waits until the selected session reaches a specified state before the next action is performed. You select the state and session in a later step.
      Wait For Percent Complete
      Waits until the selected role pair in the session reaches a certain percentage of completion before the next action is performed. You select the session in a later step.
      Validate Role Pair Consistency
      Checks the current consistency for the role pair. If it is not consistent, the task fails. You select the session in a later step.
      Validate Data Exposure
      Checks whether the data exposure is below the limit that you have specified, in terms of time in seconds. If the data exposure is greater than the specified time, the action continues to check the data exposure value until the specified timeout duration. When the data exposure is below the specified time, the action completes and the next action in the scheduled task follows. You select the session in a later step.
      Note: This action applies to DS8000® sessions and Global Mirror role pairs only.
      Run External Script

      To access a remote server using SSH and issue a specified command. This action type can be used for external actions such as quiescing an application before creating a FlashCopy® or a Safeguarded Copy backup.

    2. From the table, select the session for which you want to schedule the action. Only sessions for which the selected action can be performed are displayed.
      Note: Currently, you can only schedule an action against one session at a time. This step does not apply to a Run External Script action type.

      The following information is provided about each session that you can choose from for scheduling a task:
      Name
      The session name.
      Type
      Indicates the type of session.

      You can customize the session list by filtering information, resizing columns, reordering columns, sorting rows, and hiding columns. All changes that you make to the sorting, column sizing, column order, and table filters persist for each user on a browser across logins.

      • To filter the list by session name or type, enter the filter text in the Filter field. You can enter complete text or partial text. To remove the filtering for the list, click the X icon in the Filter field.
      • To resize a column, drag the column heading border until the column is at the width that you want.
      • To sort the rows in the list, click the heading for the column that contains the value that you want to use for sorting. For example, if you want to sort by the session type, click the Type heading. The list sorts by the value in that column. You can choose an ascending or descending sort order by clicking the column heading.
      • To reorder columns, left click and drag a column from the current location in the table to the new preferred location.
      • To hide columns or make columns visible, right-click on the table header. This action gives you a list of possible columns for the table. Or you can left-click on the icon in the upper right of the table header. Clear the check from any column to hide it from the table. Check any column to make it visible in the table.
    3. For Command, Wait For State, Wait For Percent Complete, Validate Role Pair Consistency, Validate Data Exposure, and Run External Script actions, you need to make more selections.
      For a Command action:
      • Select the command that you want to issue.
        Note: The commands that are available depend on the type of session that you select.
      For the Wait For State action:
      • Select which state to wait for before the next action is performed.
        Note: The states that are available depend on the type of session that you select.
      • Select a time, in minutes, to wait before the action times out.
      For the Wait For Percent Complete action:
      • Select the role pair. All of the Metro Mirror, Global Copy, FlashCopy, or Safeguarded Copy role pairs are listed for the selected session.
      • You can specify the percent complete, from 1% to 100%. The default setting is 100%.
      • Choose how long to wait (in minutes) for the action to reach the chosen percent complete before timing out.
      Note: If the command fails, or the state, or percent complete is not reached before the timeout time that you selected, the entire task fails and no other actions run.
      For the Validate Role Pair Consistency action:
      • Select the role pair.
      For the Validate Data Exposure action:
      • Select the role pair.
        Note: Only Global Mirror role pairs are displayed.
      • Specify the time limit in seconds. This action checks whether the data exposure is below the specified limit. When the data exposure is below the specified time, the action completes and the next action in the scheduled task follows.
      • Specify the time up to which the action will wait before timing out. If the data exposure is greater than the specified time, the action continues to check the data exposure value until the specified timeout duration.
      For the Run External Script action:
      Hostname
      Enter the hostname or IP address of the server to SSH into in order to run the script.
      Note: If the specified server has disabled some of the older key exchange algorithms, the connection to the server might fail and you need to re-enable the older algorithms on the SSH server.
      Optional: Port
      Enter the port number for the SSH connection. If no port number is entered, default SSH port 22 is used.
      user ID
      Enter the user ID that is used to create the SSH connection to the server specified by the hostname field. This user needs to exist on the server that is specified under hostname and have the authority to run the specified Command.
      Password
      Enter the password for the specified user ID.
      Command
      Enter the command to be run after the SSH connection is established.
      Note: This field does not validate the command that is entered and runs the command as entered. This would include most actions that can be run through an SSH connection. Be cautions when entering the command that is sent to the server.
      Time
      Enter the time in minutes. This is the time before the action times out.
      Success String
      Enter a success string that the action uses to compare to the stdout from the command that is issued through SSH to the server.
      • If a success string is entered, then the action is considered successful if the string is found in the stdout.
      • If a success string is not entered, then the action is considered successful only if nothing returns in stderr.
    4. Click OK to save your changes for the scheduled task action, or click Cancel to exit without saving changes.
  7. You can run a scheduled task on success or failure of this task. Find the fields below the task table that provide those options. From the pull down lists beside each option, you can choose an existing scheduled task to run on success (Run the following task if successful), or on failure (Run the following task on failure) of the current scheduled task.
    Note: The default for both options is Do not run a Task.
  8. Repeat steps 5 and 6 for every action that you want to perform in the scheduled task.
    Example:

    You might have two sessions: a Global Mirror Failover/Failback (GM) session and a Metro Mirror Failover/Failback (MM) session. In this example, the MM session is running in Global Copy mode and is cascaded off the GM session's Global Copy target volumes to a third site. You might want to periodically schedule a set of actions so that the targets of the MM session that is running in GC mode get a consistent image.

    You can schedule this set of actions as follows:
    1. Create a new task.
    2. Choose a schedule when the task runs (such as daily at midnight).
    3. Add a Command action that issues a Suspend command to the GM session. This action suspends the GM session consistently if the DS8000 supports Pause with Consistency.
    4. Add a Wait for State action that waits until the GM session is in a Suspended state.
    5. Add a Command action that issues a Suspend command to the MM session.
    6. Add a Wait for State action that waits until the MM session is in a Suspended state.
    7. Add a Command action that issues a Start H1->H2 command to the GM session. This command restarts the GM session so that replication is running again to the second site.
  9. You can change the order in which the actions are performed by clicking Up or Down. You can also delete actions by selecting them from the table and clicking Remove Action. Or you can make changes to actions by clicking Modify Action.
  10. On the next page, review the summary for the scheduled task actions. If everything is correct, click Finish. If you need to make changes, click Back to return to any pages in the wizard where changes need to be made.
  11. If you click Finish, a message indicates whether the task was created successfully.

Results

The scheduled task appears in the Scheduled Tasks table.
Note: Tasks are initially in a disabled state. You must use either the Enable command to start them according to the preset schedule, or the Run command to execute them immediately, including in a disabled state. For more information, see Enabling a scheduled task and Running a scheduled task.
The following information is provided about each scheduled task:
Name
The scheduled task name.
Type
Indicates the type of the scheduled task.
Affected Sessions
The sessions that are used for the scheduled task to run.
Status
Indicates whether the task is enabled, disabled, or running.
Schedule
The time and days of week that this task is scheduled to run.
Next Run Time
Shows the date and time of when the scheduled task will run next. When you use an hourly schedule, the scheduling is set by dividing a 24-hour day into the number of intervals that you want. For example, if you wanted to run the task every 3 hours, that would equal eight times per day. In this example, starting at midnight, the day is divided into eight intervals. If you require a specific time of the day for the task to start, use the Daily/Weekly schedule.
Last Run Time
The date and time of when the scheduled task ran the last time.
Last message
Shows the message ID of the status from the last run. To see more details, click the message to open the Help page.

You can filter and customize the scheduled tasks list as previously described for the session table in the scheduled tasks wizard.