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.

FrequencyDescription
NONEJob requires manual execution (Job status is DORMANT)
MANUALJob requires manual execution (Job status is DORMANT)
ONCEJob executes one time at the scheduled date and time
HOURLYJob executes every hour from the start time
DAILYJob executes every day at the start time
WEEKLYJob executes once a week on the same weekday and time
MONTHLYJob executes once a month on the same day and time
MONTHENDJob executes on the last day of the month at the specified time
YEARLYJob 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 StatisticDefinition
job_idUnique job identifier assigned by the manager
package_nameJob template name associated with the job
source_hostSending Agent hostname
target_hostReceiving Agents hostname
statusCurrent job status - PENDING, RUNNING, COMPLETE, or PAUSED
package_typeJob package type - OBJECT_GET, OBJECT_PUT, OBJECT_TRF, REMOTE_CMD, STREAM_TRF, or UNKNOWN
transport_type_displayTransfer method used, TCP or UDP
effective_bytesAn aggregate of file_data_bytes, file_bytes_skipped, and the sum of the data count of currently active transfers
file_countNumber of files included in the transfer
directory_countNumber of directories included in the transfer
byte_countTotal number of bytes included in the files to be transferred
files_transferredNumber of files transferred
files_skippedNumber of files skipped
files_deletedNumber of source files deleted
failed_filesNumber of files that failed to transfer
agent_start_timeThe controlling Agent start time in (Unix format)
remote_start_timeThe remote Agent start time (Unix format)
names_cmd_end_timeSpecifies the time the names command has completed (Unix format)
transfer_start_timeThe time the transfer started (Unix format)
transfer_end_timeThe time the transfer completed (Unix format)
remote_end_timeThe time the remote Agent closed the connection (Unix Format)
agent_end_timeThe Agent job control process termination time
bandwidth_throttleThe current bandwidth throttle (Bytes per second)
transfer_rateCalculated average transfer rate (Bytes per second)
transfer_rate_maxHighest transfer rate for this transfer (Bytes per second)
transfer_rate_minLowest transfer rate for this transfer (Bytes per second)
directories_transferredNumber of directories transferred
directories_skippedNumber of directories skipped during the transfer
directories_deletedNumber of directories deleted after transfer
failed_directoriesNumber of directories that failed to transfer
file_data_bytesNumber of uncompressed bytes transferred
target_filebytesNumber of bytes written to the target file
file_attr_bytesNumber of uncompressed file attribute bytes transferred
file_data_bytes_compNumber of compressed bytes transferred
file_attr_bytes_compNumber of compressed file attribute bytes transferred
file_bytes_skippedNumber of compressed file attribute bytes skipped
file_bytes_deletedNumber of compressed file attribute bytes deleted after successful transfer
rsync_bytes_skippedNumber of bytes skipped because they already existed on the target
ovhd_src_rsyncAmount of RSYNC overhead sending from the data source to the target Agents
ovhd_tgt_rsyncAmount of RSYNC overhead sending from the target Agent to the data source
ovhd_src_mnfst_compNumber of compressed source-to-target file manifest overhead bytes
ovhd_tgt_mnfst_compNumber of compressed target-to-source file manifest overhead bytes
ovhd_src_prtclNumber of source to target transfer protocol overhead bytes
ovhd_tgt_prtclNumber of target to source transfer protocol overhead bytes
ovhd_src_cchnlNumber of source to target bytes sent over the control channel
ovhd_tgt_cchnlNumber of target to source bytes sent over the control channel
sf_bytes_recvdNumber of bytes received by the controlling Agent over the Security Framework layer
sf_bytes_sentNumber of bytes received by the controlling Agent over the Security Framework layer
ntwk_bytes_sentNumber of bytes sent by the controlling agent over the network
ntwk_bytes_ackNumber of bytes sent by the controlling agent over the network
ntwk_bytes_recvdNumber of bytes received by the controlling agent over the network
udp_aggressivenessAmount of bandwidth the transfer tries to use relative to other traffic on the UDP protocol
udp_payload_sizeNumber of bytes per UDP transport packet
udp_header_sizeNumber of bytes per UDP transport packet header
udp_pkts_sentNumber of UDP packets sent by the sending and receiving Agents
udp_pkts_ackNumber of UDP packets sent by the sending and receiving Agents
udp_pkts_recvdNumber of UDP packets received by the sending and receiving Agents
udp_pkts_resentNumber of UDP packets sent more than once by the sending and receiving Agents
udp_pkts_rjctdNumber of UDP packets rejected by the sending and receiving Agents
udp_ceilingMaximum UDP transfer rate
udp_floorMinimum UDP transfer rate
rmt_cmd_twuNumber of critical errors reported by the controlling Agent
rmt_cmd_wucNumber of errors reported by the controlling agent
unrecovered_errorsNumber of unrecoverable errors reported by the controlling Agent
total_errorsTotal number of errors reported during the transfer
proc_data_bytes_sentNumber of bytes sent during a push transfer, or received in a pull transfer
proc_data_bytes_unconsumedbytes received by the target agent transferred that are not delivered to the target data sync command
tnnl_data_bytes_sentspecifies the number of bytes sent by the controlling agent across all channels of a streaming transfer
tnnl_data_bytes_recvdspecifies the number of bytes received by the source agent across all channels of a streaming transfer
agent_stat_timespecifies the controlling agent time when the statistic record was generated (Unix time)
time_estThe estimated time of how long a job is in the resource queue