Calendar scheduling

A powerful feature of BeyondCron is the ability to separate a jobs definition from its scheduling.

Defining a calendar

Define a calendar in your favourite calendar application—e.g. OSX Calendar, MS Outlook, etc…—and then publish it to a calendar server in iCalendar format. e.g. https://calendar-server/store-hours.ics

Defining a calendar

Importing the calendar into BeyondCron

BeyondCron % calendar add /calendars/store-hours Store trading hours
BeyondCron % calendar include add /calendars/store-hours https://calendar-server/store-hours.ics
BeyondCron % calendar list full /calendars/store-hours

------------ ---------------------------------------------------------- Name /calendars/store-hours Description Store trading hours iCal include https://calendar-server/store-hours.ics iCal exclude References 0 Last updated Mon Jun 09 09:40:40 JST 2014

if the store has one or more holidays, they can be defined in another calendar and published as above, and then excluded from the BeyondCron calendar.

Define a job with a calendar schedule

Define a job that is executed 15 minutes before the end of each event in the jobs calendar.

Calendar 15 minutes before end

BeyondCron % job add /store/closing Play Auld Lang Syne as store closing reminder
BeyondCron % job calendar set /store/closing /calendars/store-hours
BeyondCron % job schedule add /store/closing schedule 15 minutes before end
BeyondCron %
BeyondCron % job list full /store/closing

----------- --------------------------------------------- Name /store/closing Description Play Auld Lang Syne as store closing reminder ... Calendar /calendars/store-hours ... Schedules calendar 15 minutes before end ...

BeyondCron % job status full /store/closing

Job State ... Code Message Next Execution -------------- --------- ... ---------------------------- /store/closing Scheduled ... Mon Jun 09 19:45:00 JST 2014

Changing the schedule for a day

Close the store at 4PM rather than 8PM, due to an approaching typhoon.

  1. update the event within you calendar application, and if required republish it.

Closing early

  1. refresh calendar

The BeyondCron job /admin/updaters/calendar will automatically refresh iCalendars—and every calendar that references them—every 15 minutes. If you cannot wait for the automatic refresh, you can refresh the calendar manually.

BeyondCron % calendar refresh /calendars/store-hours
BeyondCron % calendar list full /calendars/store-hours

------------ ---------------------------------------------------------- Name /calendars/store-hours Description Store trading hours iCal include https://calendar-server/store-hours.ics iCal exclude References 1 Last updated Wed Sep 24 11:20:17 JST 201

BeyondCron % job status full /store/closing

Job State Result ... Next Execution -------------- --------- ------- ... ---------------------------- /store/closing Scheduled Success ... Web Sep 24 15:45:00 JST 2014

  1. done!

The job will now execute at 4PM rather than 8PM on September 24th, and then automatically return to normal.

See also

Reference