Cron jobs for Docker apps,
without a crontab

Run a command in your app's own container on a cron schedule, in your time zone, with the app's env. Echowa keeps every run's exit code and output, never overlaps a task with itself, and shows a failure on the app's overview.

curl -fsSL https://get.echowa.dev/install.sh | sudo bash

Scheduled tasks

On the app's own page

Each app has a Scheduled tasks section beside its deploys and logs, so the jobs that keep it running are in the same place as the app.

Every task and its last result

A switch to pause each task, Run now to start one by hand, and the last run's result. Open a task to see its runs and the output of each.

How a task runs

The same environment as your app, run the way cron would.

  • In the app's container

    A run is sh -c <command> in the app's newest running container, once however many replicas it has, with its env, user and working directory.

  • Presets or cron

    Every minute, every hour, daily, weekly or monthly, or a five-field cron expression, with the next three runs shown before you save.

  • In your time zone

    Each task has an IANA time zone, your browser's by default, and follows its clock changes.

  • Never overlaps itself

    If the last run is still going when the next one is due, that minute is skipped and logged.

  • Every run kept

    Status, exit code and the last 64 KiB of output, for the newest 100 runs of each task.

  • Failures you'll see

    A failed or timed-out run shows on the app's overview with its last lines of output, until you dismiss it, and an alert can send it to Slack, Discord, Teams, ntfy or email.

An example

Laravel's scheduler expects to be called every minute, and its own schedule decides what runs. In Echowa that's one task:

Name      Laravel scheduler
Schedule  Every minute
Command   php artisan schedule:run
Timeout   15 minutes

Anything your image can run works the same way: bin/rails runner Cleanup.run, node scripts/send-digest.js or python manage.py clearsessions. The command gets the app's env, so it reaches the same database with the same credentials.

Schedules and time zones

A schedule is a preset or a five-field cron expression, such as */2 9-17 * * 1-5 for every two minutes in working hours. Descriptors like @hourly, CRON_TZ= prefixes and dates that never come, such as the 30th of February, are refused when you save.

Times are read in the task's zone, so a task at 09:00 Europe/London runs at 09:00 London time all year. On the night the clocks go forward, a time that doesn't exist that night doesn't run. When they go back, a time that happens twice runs twice, as cron does.

Runs and their results

Each run records how it started, by schedule or by hand, and how it ended:

  • Succeeded or failed, with the command's exit code.
  • Timed out, when it ran past its timeout, 15 minutes by default.
  • Skipped, when its last run was still going or the app had no running container.
  • Interrupted, when Echowa restarted during the run.

The newest 100 runs of each task are kept, each with the last 64 KiB of its output.

What to know

  • Runs missed while Echowa is down aren't caught up afterwards, as with cron. Your apps keep running meanwhile.
  • A timeout stops Echowa waiting, but not the command, which runs on in the container until it ends.
  • A deploy replaces the containers, so a run in progress stops when its container does, usually with exit code 137.
  • The image needs sh. Distroless and scratch images fail with exit code 127.
  • Tasks belong to your own apps. Database templates don't have them.

Questions

How runs behave, in short answers.

Does a task run on every replica?

No. It runs once per schedule, in the app's newest running container, however many replicas the app has.

Does a task get my app's env vars?

Yes. It runs through docker exec in the app's container, so it has the app's env, user and working directory, and shares its CPU and memory limits.

What happens if a run takes longer than the schedule?

The next run is skipped, and Echowa logs that the last run is still going. A task never runs beside itself.

What if Echowa is down when a task is due?

That run is missed and isn't caught up later, as with cron. Echowa checks which tasks are due every minute while it runs.

Can I run a task by hand?

Yes. Run now starts one whether the task is switched on or not, and you can follow it in the task's runs.

How do I know a task failed?

The app's overview shows each task's newest failed or timed-out run, with its exit code and last lines of output, until you dismiss it. Add the Scheduled task failed or timed out alert to have it sent to Slack, Discord, Teams, ntfy or email too.

Deploy it.
Then see everything.

One server, every deploy, every number.

curl -fsSL https://get.echowa.dev/install.sh | sudo bash