Scheduling Jobs

Scheduling jobs allows you to create routine workflows to simplify data transfers between Agents. You can create jobs that run automatically in sequence by using the API to set job frequency, failure behavior, and priority.

Overview

When generating a job using the REST API, you can include Schedule job arguments that set when and how often a job runs.

Each Schedule attribute sets how the job processes:

  • Schedule.timezone - which time zone to use for the scheduled job in tz format (Required)
  • Schedule._sp_frequency - how often the job runs (See Job Frequency)
  • Schedule._sp_start_at - when the job should start running in YYYY/MM/DD HH:MM:SS format
  • Schedule._sp_interrupt_on_failure - sets the job's failure state (See Job Failure)
  • Schedule.priority - sets job priority (See Job Priority)
  • Schedule.finishBefore - sets granular job priority order (See Job Priority)

Include specific Schedule arguments within the jobArgs object within the call body. For example, the following job will start in the America/Toronto time zone on May 20, 2019, at 7:10 AM. It will run daily at 7:10 AM:

Copy
    "jobArgs" : {
                    "ObjectUploader.Schedule.timezone":      "America/Toronto",
                    "ObjectUploader.Schedule._sp_start_at":  "2019/05/20 07:10:00",
                    "ObjectUploader.Schedule._sp_frequency": "DAILY",
                    "ObjectUploader.Schedule._sp_interrupt_on_failure": "no",
                    "ObjectUploader.Schedule.priority": "",
                    "ObjectUploader.Schedule.finishBefore": "",
                    ...
                }

Job Frequency

Jobs can be configured to run at a specified time and frequency. Job runs use Schedule._sp_frequency and Schedule._sp_start_at job arguments to determine a job's first run and any subsequent runs.

Frequency Description
NONE Job requires manual execution (Job status is DORMANT)
MANUAL Job requires manual execution (Job status is DORMANT)
ONCE Job executes one time at the scheduled date and time
HOURLY Job executes every hour from the start time
DAILY Job executes every day at the start time
WEEKLY Job executes once a week on the same weekday and time
MONTHLY Job executes once a month on the same day and time
MONTHEND Job executes on the last day of the month at the specified time
YEARLY Job executes once a year on the specified date and time

Ordinals

You can specify jobs to run on a particular weekday within a specific month, such as the second Thursday or the last Friday of a month:

Copy
    "jobArgs" : {
                    ...
                    "ObjectUploader.Schedule._sp_frequency": "SECOND MONDAY",

                    ...
                }

You can set Schedule._sp_frequency to use:

  • FIRST / 1ST
  • SECOND/2ND
  • THIRD/3RD
  • FOURTH/4TH
  • LAST

Intervals

You can specify that jobs run at specified intervals, such as every five hours, or every two weeks:

Copy
    "jobArgs" : {
                    ...
                    "ObjectUploader.Schedule._sp_frequency": "2 WEEKS",

                    ...
                }

You can set Schedule._sp_frequency to use:

  • MONTHS / M
  • MINUTES / MI
  • HOURS / H
  • DAYS / D
  • WEEKS / W
  • YEARS / Y

Job Failure

You can specify how a job behaves if it encounters an error or fails to complete using the Schedule._sp_interrupt_on_failure option.

Setting Schedule._sp_interrupt_on_failure to yes sets the job status to INTERRUPTED and will not continue, preserving the job environment, including workflow component inputs and outputs. Once resumed, the job restarts at the beginning of the workflow component that failed.

Setting Schedule._sp_interrupt_on_failure to no will end a job when it fails and display FAILED status.

Job Priority

Agents using concurrency resource controls limit the number of jobs running at a time, adding any additional jobs to a queue. The Schedule.priority and Schedule.finishBefore arguments determine how to order queued jobs, while jobs without a Schedule.priority or Schedule.finishbefore are processed in the order they are added to the queue.

The Schedule.priority argument sets a job's overall priority level in order to place it in sequence.

You can set Schedule.priority to use:

  • LOW / 1
  • MEDIUM / 2 (Default)
  • HIGH / 3
  • CRITICAL / 4
  • IMMEDIATE / 5

Note: Schedule.priority accepts strings containing either the specific priority (e.g. LOW) or a numerical value (e.g. 1). Whenever information is retrieved from the Manager API, it is displayed as the specific priority level.

The Schedule.finishBefore argument determines how to queue jobs that have the same priority level, but may need to run in a specific sequence, or sooner than a previously queued job.

Set finishBefore using a date and time in YYYY/MM/DD HH:MM:SS format.

Example

As an example, two jobs are sent to the same resource controlled Agent or job group:

Copy
    "jobName" : "example one - without a finishBefore set"
    "jobArgs" : {
                    ...
                    "ObjectUploader.Schedule.priority": "MEDIUM",
                    "ObjectUploader.Schedule.finishBefore": "",
                    ...
                }
Copy
        "jobName" : "example two - with a finishBefore set"
        "jobArgs" : {
                    ...
                    "ObjectUploader.Schedule.priority": "MEDIUM",
                    "ObjectUploader.Schedule.finishBefore": "2019/05/21 07:10:00",
                    ...
                }

If both jobs are sent to the Manager, example two will be queued by the Manager first. It has a Schedule.finishBefore set, and so will take priority over the other job.

Job Statistics

After a job run starts, sending POST requests to the /jobs/stats/ endpoint provides specific job statistics for a job run.

Requests to /jobs/stats/{jobname}/{jobgroupname|jobgroupID} show the statistics for the most recent job run, or ​/jobs​/stats​/{jobname}​/{jobgroupname|jobgroupID}​/{runNumber} to request statistics from a specific run.

Note: To view the most recent job run, use 0 as the runNumber.

The request must include a JSON data body containing stats endpoint that includes the statistics to be returned.

Example Request Body

Copy
[
  "source_host",
  "target_host",
  "status",
  "file_count",
  "byte_count",
  "files_transferred",
  "files_skipped",
  "files_deleted",
  "failed_files",
  "transfer_rate",
  "transfer_rate_max",
  "transfer_rate_min",
  "file_data_bytes",
  "file_bytes_skipped",
  "total_errors"
]

Statistics Reference

Jobs include the following statistic types:

Job Statistic Definition
job_id Unique job identifier assigned by the manager
package_name Job template name associated with the job
source_host Sending Agent hostname
target_host Receiving Agents hostname
status Current job status - PENDING, RUNNING, COMPLETE, or PAUSED
package_type Job package type - OBJECT_GET, OBJECT_PUT, OBJECT_TRF, REMOTE_CMD, STREAM_TRF, or UNKNOWN
transport_type_display Transfer method used, TCP or UDP
effective_bytes An aggregate of file_data_bytes, file_bytes_skipped, and the sum of the data count of currently active transfers
file_count Number of files included in the transfer
directory_count Number of directories included in the transfer
byte_count Total number of bytes included in the files to be transferred
files_transferred Number of files transferred
files_skipped Number of files skipped
files_deleted Number of source files deleted
failed_files Number of files that failed to transfer
agent_start_time The controlling Agent start time in (Unix format)
remote_start_time The remote Agent start time (Unix format)
names_cmd_end_time Specifies the time the names command has completed (Unix format)
transfer_start_time The time the transfer started (Unix format)
transfer_end_time The time the transfer completed (Unix format)
remote_end_time The time the remote Agent closed the connection (Unix Format)
agent_end_time The Agent job control process termination time
bandwidth_throttle The current bandwidth throttle (Bytes per second)
transfer_rate Calculated average transfer rate (Bytes per second)
transfer_rate_max Highest transfer rate for this transfer (Bytes per second)
transfer_rate_min Lowest transfer rate for this transfer (Bytes per second)
directories_transferred Number of directories transferred
directories_skipped Number of directories skipped during the transfer
directories_deleted Number of directories deleted after transfer
failed_directories Number of directories that failed to transfer
file_data_bytes Number of uncompressed bytes transferred
target_filebytes Number of bytes written to the target file
file_attr_bytes Number of uncompressed file attribute bytes transferred
file_data_bytes_comp Number of compressed bytes transferred
file_attr_bytes_comp Number of compressed file attribute bytes transferred
file_bytes_skipped Number of compressed file attribute bytes skipped
file_bytes_deleted Number of compressed file attribute bytes deleted after successful transfer
rsync_bytes_skipped Number of bytes skipped because they already existed on the target
ovhd_src_rsync Amount of RSYNC overhead sending from the data source to the target Agents
ovhd_tgt_rsync Amount of RSYNC overhead sending from the target Agent to the data source
ovhd_src_mnfst_comp Number of compressed source-to-target file manifest overhead bytes
ovhd_tgt_mnfst_comp Number of compressed target-to-source file manifest overhead bytes
ovhd_src_prtcl Number of source to target transfer protocol overhead bytes
ovhd_tgt_prtcl Number of target to source transfer protocol overhead bytes
ovhd_src_cchnl Number of source to target bytes sent over the control channel
ovhd_tgt_cchnl Number of target to source bytes sent over the control channel
sf_bytes_recvd Number of bytes received by the controlling Agent over the Security Framework layer
sf_bytes_sent Number of bytes received by the controlling Agent over the Security Framework layer
ntwk_bytes_sent Number of bytes sent by the controlling agent over the network
ntwk_bytes_ack Number of bytes sent by the controlling agent over the network
ntwk_bytes_recvd Number of bytes received by the controlling agent over the network
udp_aggressiveness Amount of bandwidth the transfer tries to use relative to other traffic on the UDP protocol
udp_payload_size Number of bytes per UDP transport packet
udp_header_size Number of bytes per UDP transport packet header
udp_pkts_sent Number of UDP packets sent by the sending and receiving Agents
udp_pkts_ack Number of UDP packets sent by the sending and receiving Agents
udp_pkts_recvd Number of UDP packets received by the sending and receiving Agents
udp_pkts_resent Number of UDP packets sent more than once by the sending and receiving Agents
udp_pkts_rjctd Number of UDP packets rejected by the sending and receiving Agents
udp_ceiling Maximum UDP transfer rate
udp_floor Minimum UDP transfer rate
rmt_cmd_twu Number of critical errors reported by the controlling Agent
rmt_cmd_wuc Number of errors reported by the controlling agent
unrecovered_errors Number of unrecoverable errors reported by the controlling Agent
total_errors Total number of errors reported during the transfer
proc_data_bytes_sent Number of bytes sent during a push transfer, or received in a pull transfer
proc_data_bytes_unconsumed bytes received by the target agent transferred that are not delivered to the target data sync command
tnnl_data_bytes_sent specifies the number of bytes sent by the controlling agent across all channels of a streaming transfer
tnnl_data_bytes_recvd specifies the number of bytes received by the source agent across all channels of a streaming transfer
agent_stat_time specifies the controlling agent time when the statistic record was generated (Unix time)
time_est The estimated time of how long a job is in the resource queue