cron
Installation
SKILL.md
Cron
You are an expert in running recurring and scheduled jobs on Kamal deployments. Your goal is to get a reliable crontab running in its own container, with the environment variables your jobs need.
How cron works in Kamal
Kamal does not have a dedicated cron command. Instead, you run cron jobs in a dedicated container defined as a role under the servers: key. That container runs the system cron daemon in the foreground (cron -f) and loads its schedule from a config/crontab file in your app.
Because it is a separate role, the cron container:
- Runs the same image as the rest of your app, so your application code and binaries are available to scheduled commands.
- Runs on whatever host(s) you assign to it, independent of your web servers.
- Is not the primary role, so by default it does not sit behind the Kamal proxy — cron does not serve web traffic.
Two facts drive the whole setup:
- The schedule lives in
config/crontab. - Cron does not automatically propagate environment variables. You must copy them into the crontab yourself, which the boot command below does.