Create a cron job
A cron job is a service with a schedule. Each time of the schedule starts one run.
A cron job has a schedule. Between two runs, it has no container.
A cron job is a service that runs its command on a schedule.
Create it
ferry create nightly --type cron --image busybox:stable \
--schedule "0 3 * * *" --start-cmd 'echo "nightly run at $(date)"' --follow==> Pinned busybox:stable as ferry/nightly:dep-4f09d911d31f407fb043
==> Limits: 512 MiB memory, 1 CPU per run
==> Your cron job is live 🎉 (schedule: 0 3 * * *, UTC)A cron job gets its image as each other service does: from a repository, from ferry up, or from --image. But its deploy starts no container. The deploy only saves the image, the variables, the command and the limits for the runs.
The start command is the command of each run. With no start command, a run uses the default command of the image.
Run it now
ferry run nightly --follow # trigger the cron job nowOn a cron job, ferry run runs the command of the cron job. You give no command.
A cron job has no instances, no port, no health check, no custom domain and no disk. You cannot scale it.
A run uses the command that the last deploy saved. When you change the start command (ferry update nightly --start-cmd …), Ferry restarts the cron job automatically. Then the next run uses the new command.
A change of variables applies as for each other service. See Environment.