Skip to content

Cron Job Scheduler Timeline

Run MicroSim in Fullscreen

Specification

The full specification below is extracted from Chapter 12: File Management, Packages, and Remote Access on the Pi 500+.

Type: timeline
**sim-id:** cron-job-scheduler-timeline<br/>
**Library:** vis-timeline<br/>
**Status:** Specified

Learning objective: Students will *apply* (Bloom L3: Apply) cron schedule syntax to predict the specific times a scheduled shell script will run over a sample day.

Canvas: 700x360px vis-timeline instance, responsive — vis-timeline resizes automatically to its container's width; call `timeline.redraw()` inside a window `resize` listener to ensure it stays correctly rendered.

Layout: a vis-timeline showing a single 24-hour day, with small event markers plotted at every time the current cron schedule would run the `battery_check.sh` script (starting with `*/15 * * * *`, producing a marker every 15 minutes).

Controls: a `createSelect()` dropdown labeled "Cron Schedule" with three preset options — `*/15 * * * *` (every 15 minutes), `0 * * * *` (once every hour, on the hour), `0 9 * * *` (once daily at 9 AM) — each re-populating the timeline's markers to match.

Interaction: clicking any marker on the timeline opens a vis-timeline-native popup (or a small infobox below the timeline) stating the exact time the script ran and restating, in plain language, what the currently selected cron schedule means. A short caption above the timeline always shows the currently selected raw cron syntax alongside its plain-language translation.

Implementation: vis-timeline `Timeline` class with a `DataSet` of point-in-time items recalculated whenever the schedule dropdown changes, using simple modular-arithmetic logic in JavaScript to generate the matching times for each of the three preset schedules over one 24-hour period.