Running the scheduler
| Command | What it does |
|---|---|
kscript schedule work | Every minute, until Ctrl+C. |
kscript schedule run | The tasks due this minute, then stop. |
kscript schedule run --task feeds | One task now, to try it. |
kscript schedule list | Each task, when it runs and its next run. |
kscript serve --with-worker --with-scheduler | Both inside the server, while you work on a site. |
In production, run kscript schedule work as a service next to kscript worker, or add one line to the system's crontab that runs the due tasks each minute:
* * * * * cd /srv/shop && kscript schedule run >> /var/log/shop-schedule.log 2>&1Each minute's run loads the schedule file afresh, so a change to it takes effect the next minute without a restart. A task that takes longer than a minute doesn't hold up the next minute's tasks. --file names another schedule file; without it the scheduler looks for schedule.kscript, then routes/schedule.kscript.