Skip to content

Schedules ​

A schedule is a saved test (any type, including a PBX watch) plus when to run it: once at a given time, or repeatedly on a cron expression. Each schedule keeps a history: every due time with what happened and, for runs that started, their verdict.

Use schedules for nightly regression checks ("does the echo test still pass?", "is the limit still ≥ 3 CPS?"), for a daily watch of business hours, or to run a long test at night when nobody is on the PBX.

First step: open New test, set up the test, choose Schedule instead of Start now (Create a schedule).

New test in Schedule mode
New test → Schedule: the same form, saved with a name and a cron expression; the next due times are previewed.

Create a schedule ​

Three ways, all leading to the New test form in Schedule mode:

  • New test → fill in the test → switch Start now / Schedule to Schedule.
  • Schedules → New schedule.
  • On a run page: Schedule… (this run's settings as a new schedule). Run again… reuses them for a run started now.

The schedule part of the form:

Field (UI)API fieldDefaultRules
Schedule namename—required, at most 100 characters
Runscron or run_atrepeatedlyrepeatedly (a cron expression) or once (a date and time) — exactly one
When—Every day at 02:00presets: Every day at 02:00, Weekdays at 07:00, Every hour, Every 6 hours, Sundays at 03:00, First of the month at 04:00, or Custom
Cron expressioncron0 2 * * *5 fields, see below; the next 3 due times are shown with the server's time zone
Atrun_attomorrow 02:00once: must be in the future
Enabledenabledona switched-off schedule keeps its history and never fires

The saved test is the full test request (type, profile, extension set, settings, pass/fail criteria). It always belongs to the profile it was made for. Creating, editing, switching and deleting need the operator role; everyone can view schedules (see Users and roles).

Write the cron expression ​

Standard 5-field cron, evaluated in the local time zone of the machine PBXsight runs on:

┌ minute       0–59
│ ┌ hour       0–23
│ │ ┌ day      1–31
│ │ │ ┌ month  1–12 or JAN–DEC
│ │ │ │ ┌ weekday 0–7 or SUN–SAT (0 and 7 = Sunday)
│ │ │ │ │
0 2 * * *        every day at 02:00
SyntaxMeaningExample
*every value* * * * * = every minute
a-brange0 8-18 * * * = on the hour from 08:00 to 18:00
*/n, a-b/nevery n-th*/15 * * * * = every 15 minutes; 0 8-18/2 * * * = 08, 10, … 18
a/nfrom a, every n-th to the end5/20 * * * * = minutes 5, 25, 45
a,b,clist30 1 * * 1,3,5 = Mon, Wed, Fri at 01:30
namesmonths and weekdays, any case0 7 * * MON-FRI

Macros: @hourly (0 * * * *), @daily and @midnight (0 0 * * *), @weekly (0 0 * * 0), @monthly (0 0 1 * *), @yearly and @annually (0 0 1 1 *).

Day of month and weekday: as in Vixie cron, when both fields are restricted, a day matches if either matches. 0 3 1 * MON runs on the 1st of every month and every Monday, not only on Mondays that are the 1st.

Daylight saving time: due times follow the wall clock. A time that doesn't exist on the day the clocks go forward (e.g. 02:30 when 02:00 jumps to 03:00) doesn't run that day. Times in the hour that repeats when the clocks go back follow the wall clock as well; avoid scheduling inside that hour if a double run would matter.

An expression that never matches within 5 years (e.g. 0 0 31 2 *) is refused.

When a schedule fires ​

PBXsight checks the due times every 5 seconds against the wall clock (a check rather than long timers, so a computer waking from sleep sees the real time). When a schedule is due:

SituationLogged asWhat happens
Nothing else running, the test startsstarted (then the run's verdict: passed / failed / no verdict, or "limit 3 CPS" for a limit run)the run is linked to the schedule (a scheduled chip on the run page) and logged in the activity log as started by (schedule)
Another run is active (or being started)skipped — "another run was active (run id)"nothing is queued; the next due time follows the schedule
The due time was found more than 5 minutes latemissed — "due … ago — the app wasn't running or the computer was asleep"no run: a test shouldn't start at an unexpected time
The test can't startnot started — with the reasone.g. a validation problem, no valid licence, ESL not connected for a watch, no phone registered

Further rules:

  • Only while the app runs. Schedules live inside the PBXsight process. While it is stopped (or the computer sleeps) nothing runs, and nothing is caught up afterwards. missed is logged when the computer slept past a due time while the app was running, and for a one-off whose time passed while the app was stopped. After a restart, a cron schedule simply continues with its next due time from then on (due times during the downtime leave no entry).
  • One run at a time, like everywhere else (the always-on watch runs beside and never causes a skip). Two schedules due at the same time: the earlier due time first; at the same time the older schedule wins and the other is skipped. The form warns when a run takes longer than the gap between two due times — the next one would be skipped.
  • One-off schedules switch themselves off after their time, whatever happened (started, skipped, missed or not started). To run it again, edit it and pick a new time; switching on a one-off whose time is past is refused.
  • A licence is needed to start runs, as for runs started by hand; without one, due runs are logged as not started (see Licence).

Fix a schedule that doesn't start ​

When saving (create, edit), 422 with every problem:

  • name present (≤ 100 characters); exactly one of cron or a time; cron valid and matching within 5 years; a one-off time in the future (when enabled);
  • the saved test decodes strictly (no unknown fields) and its profile exists;
  • the test passes the same validation as a start — extension set of that profile, safety limits, destinations, step and phone rules; for a watch, ESL enabled in the profile.

What depends on the moment is checked only at the due time: no other run active, ESL connected for a watch, the phones registering, the licence. A schedule saved months ago can also fail later because the profile's safety limits or the extension set changed — it is then logged as not started with the reason.

Run a schedule now ​

Run now (on the Schedules list and a schedule's page) starts the saved test immediately, exactly like a start by hand: it is refused with 409 while another run is active, 422 for validation problems, 402 without a licence. A run started this way is linked to the schedule and appears in its history (marked "run now"); it doesn't change the next due time.

Follow the history on the Schedules pages ​

Schedules list
Schedules: when each runs, the next due time and the history strip (oldest → newest).
  • Schedules lists the profile's schedules: Name, Test, When, Next run, History (the last 30 due times as coloured marks, oldest → newest; hover for details, click to open the run), Last, and Run now / Switch off / Switch on / Edit.
  • A schedule's page shows the same buttons plus Delete, the History table (newest first, up to the last 500: due time, result, run, vs baseline, details, report link) and the Saved test.

vs baseline in the history is each run's headline metric against the baseline — setup p95 for call and busy hour, the limit for find the limit, success rate for registrations, post-dial delay p95 for watches — green when better, red when worse, — without a baseline. A schedule's runs form their own test: mark one of them as the baseline on its run page. Until the schedule has one, its runs are compared with the baseline of the same profile and type started by hand.

History colours: passed (green), failed or not started (red), skipped or "below N CPS" (amber), running or a limit without a required limit (blue), missed or no verdict (grey).

One schedule with its history
A schedule's page: history with each run's verdict, and the saved test.

Avoid common mistakes ​

  • Keep the computer awake (and PBXsight running) for the schedule's time. On a server install with the systemd service this is a given; on a laptop it is not.
  • Leave margin between runs: a nightly limit run that ends at 02:20 and a watch at 02:15 means the watch is skipped.
  • Use Required limit (min_limit_cps) on scheduled limit runs to get a pass/fail in the history instead of only a number.
  • Mark a baseline on a good scheduled run and set a regression criterion such as max_setup_p95_increase_pct or max_limit_cps_drop_pct: the history then turns red when the PBX got worse after a change (see Baselines).
  • Edit, don't recreate: editing keeps the history; a changed when or test takes effect from the next due time.

PBXsight — load testing and monitoring for FreeSWITCH PBXes. Only test systems you own or may test.