Scheduling DataStage® jobs

You can schedule a DS job to run at a specific time or frequency using the built-in scheduler.

Before you begin

Download the latest version of cpdctl. Check for the latest version on this page: https://github.com/IBM/cpdctl/releases/

Procedure

  1. Create a shell script to initialize the cpdctl environment. See the following example:
    #!/bin/bash
    
    export DSJOB_URL=https://cpd-ds.apps.tahoetest631.cp.fyre.ibm.com
    export CPDCTL_ENABLE_DSJOB=true
    export DSJOB_USER=cpadmin
    export DSJOB_PWD=<PASSWORD>
    cpdctl config user set tahoetest631-user --username $DSJOB_USER --password $DSJOB_PWD
    cpdctl config profile set tahoetest631-profile --url $DSJOB_URL --user tahoetest631-user
    cpdctl config profile use tahoetest631-profile
    export CPD_PROFILE=tahoetest631-profile
  2. Run the shell script.
  3. Schedule your job run using the following command:
    
    cpdctl dsjob schedule-job {--project PROJECT | --project-id PROJID} {--job NAME | --name NAME | --job-id ID | --id ID} [--schedule-start yyyy-mm-dd:hh:mm] [--schedule-end yyyy-mm-dd:hh:mm] [--repeat every/hourly/daily/monthly --minutes (0-59) --hours (0-23) --day-of-week (0-6) --day-of-month (1-31)] [--remove-schedule]