Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A command that works by hand can still fail under cron because cron may use a different account, shell, environment, working directory, permissions, or time basis. First determine whether the scheduler dispatched the job; then use captured output and the exit status to diagnose what happened inside it.

1. Identify the scheduler and host

Start by confirming the operating system, which cron-compatible scheduler is installed, and how that host records scheduler activity. “Cron” does not guarantee one implementation or one logging location. For example, the Debian cron manual and the Debian systemd-cron manual describe different implementations. Check the installed man pages and the service manager on the machine you are debugging; do not assume another distribution’s service name, defaults, or log path applies.

2. Confirm the entry is installed in the right place

Compare the exact file you edited with the crontab actually loaded for the job’s intended account. A user crontab belongs to its owner. System-wide files such as Debian’s /etc/crontab and files in /etc/cron.d use a username field after the five schedule fields; that extra field does not belong in a user crontab. Debian also documents ownership, writability, and filename requirements for system cron files.

List the crontab for the account that should run the job, using the host’s documented command, and verify the entry appears there exactly as intended. If the entry is in a system file, check that file’s format and permissions against the installed cron manual.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

3. Check the schedule and the clock

A standard cron schedule has five fields, in this order: minute, hour, day of month, month, and day of week, followed by the command. POSIX defines that baseline, but individual implementations may add syntax or handle date-field matching differently. Consult the host’s manual when an entry uses extensions or when its calendar behavior is unclear. The POSIX crontab specification describes the portable fields.

Check the machine’s current clock and timezone, then test against the next actual matching minute. A schedule that looks right in a local calendar may not match the host’s time basis or the intended date fields.

4. Verify the account and permissions

A user crontab runs as its owner. A system-wide job may specify a separate user. Reproduce the job as that exact identity: running it manually as your own account does not test the scheduled account’s access.

Check whether the scheduled user can read and execute the script, traverse every parent directory, access input files and credentials, and write to output or log locations. Also verify access to any network share or mounted resource the job needs. A resource that is available in your interactive session may not be available or mounted for the scheduled account.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

5. Make the shell and environment explicit

Cron does not promise to recreate an interactive login session. POSIX specifies a baseline environment that includes HOME, LOGNAME, PATH, and SHELL, with sh as the POSIX shell; implementations can set defaults or add extensions. The actual environment depends on the scheduler and host configuration. See the POSIX crontab specification for the portable baseline.

  • Use absolute paths to the interpreter and programs the job invokes.
  • Set required environment variables explicitly in the crontab or script.
  • Use syntax supported by the shell cron actually invokes; do not rely on aliases, shell startup files, or interactive-only features.
  • Check the working-directory assumptions in the script and use absolute paths for files it reads or writes.

Debian’s classic cron and Debian’s systemd-cron have their own documented behavior, so use the applicable manual rather than treating a general cron example as universal.

6. Capture output and the exit status

Temporarily redirect both standard output and standard error to a file the scheduled user can write, or add explicit logging to the script. For example, a user-crontab entry can send both streams to a chosen log file with >> /path/to/job.log 2>&1; replace that path with one writable by the job’s account. If possible, have the script log its start time and final exit status as well.

Check the scheduled account’s cron mail if mail delivery is configured. POSIX says unredirected output and errors are sent by an implementation-defined method. Debian cron documents syslog logging, while Debian systemd-cron documents journal-backed logs and MAILTO. Neither a particular mail setup nor a universal log location should be assumed.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

7. Use scheduler logs to locate the failure

Look around the expected run time in the host’s cron logging facility or system journal. The key distinction is whether there is evidence the scheduler dispatched the entry:

  • No dispatch evidence: check whether the scheduler service was active, whether the entry was installed in the intended crontab, whether its syntax and permissions are accepted, whether the host clock reached the scheduled time, and whether the machine was running.
  • Dispatch evidence present: the scheduler attempted the job. Use the redirected output, exit status, and application logs to investigate its shell, paths, permissions, environment, or dependencies.

Logging controls and commands vary by implementation. Debian cron documents its logging options and syslog behavior; use the installed manual and service manager to find the equivalent evidence on your host.

8. Account for downtime, timezones, and clock changes

Do not assume a missed schedule will be replayed. Oracle Linux 9 documentation says a job scheduled while the system is down is skipped until its next scheduled run. Debian cron documents special behavior for small clock changes, including daylight-saving transitions, and Debian systemd-cron supports a job timezone variable. These are implementation-specific details, not universal guarantees.

If the expected run coincided with downtime or a timezone or clock change, check the scheduler’s documentation for that implementation and verify the host’s time settings before changing the schedule.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A quick decision path

  1. Confirm the operating system, scheduler implementation, and relevant service and log facilities.
  2. Verify the entry is present in the intended user crontab or correctly formatted system file.
  3. Check the five schedule fields against the host clock and timezone, then wait for a matching minute.
  4. Test access and dependencies as the scheduled account, not just from your own interactive session.
  5. Make shell, environment, executable paths, and file paths explicit.
  6. Capture stdout and stderr, record the exit status, and check scheduler logs at the expected run time.
  7. If the host was down or its clock changed, consult the implementation-specific missed-run and timezone behavior.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.