Documentation
</> Developer Portal

NAME

rt-run-scheduled-processes - Check for scheduled processes and run them

SYNOPSIS

    rt-run-scheduled-processes [options]

DESCRIPTION

This tool will find any scheduled processes that are scheduled and run them.

Each scheduled process has a minute and hour, and possibly day of week or day of month. These are taken to be in the RT server timezone.

Each scheduled process carries a counter which is incremented every time the process runs successfully. Weekly processes configured to run every N weeks use that counter to work out which weeks they are due; on the weeks they are not due the counter is incremented without the process running.

A run that fails does not increment the counter, so a weekly process is considered due again the following week rather than waiting out the full N weeks.

SETUP

You'll need to have cron run this script every 15 minutes. Here's an example crontab entry to do this.

    */15 * * * * /opt/rt6/bin/rt-run-scheduled-processes

This will run the script every 15 minutes, every hour. This may need some further tweaking to be run as the correct user.

OPTIONS

This tool supports a few options. Most are for debugging.

-h
--help

Display this documentation

--dryrun

Figure out which scheduled processes would be run, but don't actually run them. Counters are left untouched, so a dry run does not disturb the schedule of weekly processes.

--time SECONDS

Instead of using the current time to figure out which scheduled processes should be run, use SECONDS (usually since midnight Jan 1st, 1970, so 1192216018 would be Oct 12 19:06:58 GMT 2007).

--all

Ignore scheduled process frequency when considering each scheduled process. This will run all enabled scheduled processes.

A successful run increments the counter described above, which shifts the schedule of any weekly process configured to run every N weeks (where N is greater than one). Each of its later runs happens a week earlier than it otherwise would, and the cadence stays offset from then on. If the process was due on its next scheduled day, that run is skipped.

--log LEVEL

Adjust LogToSTDERR config option

← Back to index