pastesite.com New paste

Share a cron schedule that someone can replay

By · Published 2026-11-30 · reviewed 2026-11-13 · 2 min read

AI-assisted article. Reviewed by Codebuff automated editorial review on 2026-11-13. Examples are illustrative, not real user data.

A cron entry looks portable and is not. The same five fields run in a different timezone, as a different user, with a different shell, and on some systems they do not run at all because the format belongs to a different scheduler. When a scheduled job misbehaves, the schedule line is only the beginning of the evidence; the rest is the environment it ran in and what it printed.

Why is the cron line the smallest part of the question?

Two hosts with the same crontab can behave differently because one runs the job at 02:30 UTC and the other at 02:30 local, or because one user has a different `PATH`. Neither difference appears in the five fields, so a schedule pasted without them is ambiguous in exactly the way that matters.

State the scheduler as well. Vixie cron, busybox cron and a systemd timer all accept something that looks like a schedule and disagree about environment, overlap handling and what happens when a run takes longer than the interval.

Send the entry with its environment

The variables at the top of a crontab are part of the schedule: `SHELL`, `PATH`, `MAILTO` and any application variable the job reads. Remove the secrets from them, keep the rest, and the reader can see why a command works in a terminal and fails in cron.

Include how the entry is installed: user crontab, `/etc/cron.d`, or a timer unit. The format differs between them, and a line that is valid in one is ignored in another without any error.

# What the user pasted
30 2 * * * /usr/local/bin/backup.sh >> /var/log/backup.log 2>&1

# What the reader needs
# crontab -l (user deploy, host web-02), TZ=UTC
SHELL=/bin/bash
PATH=/usr/local/bin:/usr/bin:/bin
MAILTO=ops@example.invalid
30 2 * * * /usr/local/bin/backup.sh >> /var/log/backup.log 2>&1

# Last run: 2026-11-19T02:30:04Z, exit 1
# backup.sh: pg_dump: command not found (PATH did not include /usr/lib/postgresql/16/bin)

Reproduce a missed or failed run

A missed run and a failed run look the same from the outside, so the evidence differs: for a miss, the system log around the scheduled minute; for a failure, the exit code and the last lines of output. Include whichever you have, plus the clock reading from the same host, which settles timezone questions immediately.

If the job overlaps with itself, say how long a normal run takes. An entry that starts every ten minutes and takes twelve will queue up on some systems and be skipped on others, and that difference is often the bug.

Name the host, the user and the version

One line naming the host, the account, the operating system and the cron implementation removes most of the ambiguity left by the schedule. If the job runs on several hosts, say which ones behave differently and whether their configuration files are supposed to be identical.

Finally, say what you expected. A job that runs at 02:30 UTC is not wrong because you expected local time; it is wrong because something else depends on it running later, and only you know what that something is.

Sources and editorial review

Prepared with AI assistance and checked against the plain-text and config sharing pages at the reviewed revision: scheduler differences, crontab environment variables, missed-versus-failed evidence and host attribution. The host, user and log lines are illustrative, and the mail address uses the reserved .invalid domain.