Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk5 min

How to Debug a Cron Job That Runs Manually but Not on Schedule

A manual success does not guarantee cron uses the same account, shell, environment, permissions, or timing. Trace dispatch first, then compare the scheduled context.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If a command works when you launch it yourself but appears not to run from cron, first determine whether cron dispatched it. If it did, debug the command’s scheduled-run context; if not, check the installed entry, schedule, service, clock, and host. The manual run only proves the command worked under the account, shell, environment, and timing you used then.

1. Identify which scheduler is running

Start with the operating system, cron implementation or compatible scheduler, and the service and logging setup on that host. Documentation for Debian’s classic cron and Debian’s systemd-cron describes different implementations; neither should be treated as universal. Check the installed man pages and service manager for the actual host and use those to identify service names, log locations, supported syntax, and defaults.

As an Amazon Associate I earn from qualifying purchases.

This distinction matters throughout debugging: cron-like configuration may be handled by a traditional daemon or translated into systemd behavior. Do not apply one implementation’s logging instructions or extensions to another without checking.

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.

2. Verify the entry is installed in the right place

Inspect the crontab belonging to the account expected to run the job, then compare it with the file you edited. A user crontab belongs to its owner. System-wide files such as Debian’s /etc/crontab and files in /etc/cron.d use a different layout: after the five time and date fields, they include a username field before the command. Putting that username in a user crontab shifts the command fields and can make the entry invalid or behave differently than intended.

For Debian system cron files, also verify the documented ownership, writability, and filename requirements. A file that looks correct but is ignored because it is in the wrong location or does not meet those requirements will not produce the expected run.

3. Check the schedule against the host’s clock

A POSIX-style cron schedule has five fields—minute, hour, day of month, month, and day of week—followed by the command. Confirm each field, then consult the installed implementation’s manual for extensions and date-matching rules. Check the machine’s current clock and timezone, and allow the next matching minute to arrive when testing; saving an entry does not necessarily run it immediately.

Consider whether the host was up when the scheduled time arrived. Oracle Linux 9 documentation says a job scheduled while the system is down is skipped until the next scheduled run. Do not assume a missed invocation is replayed.

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

Clock and timezone behavior is implementation-specific. Debian cron documents special handling of small clock changes, including daylight-saving transitions, while Debian systemd-cron supports a job timezone variable. Confirm the behavior for the scheduler actually installed rather than assuming all cron implementations interpret clock changes alike.

4. Compare the scheduled user and its permissions

A user crontab runs commands as the crontab’s owner. A system-wide job may specify a user. Compare that identity with the one used for your successful manual test: running the same command as a different account is not an equivalent test.

Under the scheduled account, check access to each part of the job’s path and inputs, not just whether the script file is executable:

  • The script and every parent directory must be accessible.
  • Input files, output and log locations, and any credentials must be available to that account.
  • Network services and mounted resources must be reachable in the scheduled context.

If access differs, either correct the permissions or run the job under the intended account. Avoid solving a permission problem by granting broader access than the job needs.

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

5. Recreate cron’s shell and environment

A cron command does not automatically inherit the interactive login environment from your terminal. POSIX specifies a baseline environment that includes HOME, LOGNAME, PATH, and SHELL, with sh as the POSIX shell; an implementation may set defaults or offer extensions. That baseline is not a promise of your usual shell startup files, aliases, or interactive settings.

Make the scheduled command explicit: use absolute paths for the interpreter and executables, set any required environment variables in the job or script, and use syntax supported by the shell cron invokes. If the script depends on a particular shell, name that interpreter in its shebang and ensure the path is valid. A command that relies on a terminal’s PATH, shell functions, or profile setup can work by hand and fail under cron.

6. Capture the job’s output and exit status

Temporarily send both standard output and standard error to a file writable by the scheduled account, or add explicit logging inside the script. For a simple command, a temporary entry can look like this:

* * * * * /absolute/path/to/script.sh >> /absolute/path/to/cron-debug.log 2>&1

Use a real schedule and paths appropriate to your system, then remove the frequent test schedule when finished. The redirect captures command output; if you need a reliable exit status, log it explicitly in a wrapper or in the script, since a redirected output file does not itself report success or failure.

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

Also check cron mail for the job’s account if mail is configured. POSIX leaves the delivery method for unredirected output and errors implementation-defined. Debian cron documents syslog logging; Debian systemd-cron documents journal-backed logs and MAILTO. The log destination and mail behavior therefore depend on the installed scheduler and host configuration.

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 in the host’s cron logging facility or system journal around the expected run time. First search for evidence of dispatch; then use the output, exit status, and application logs to investigate the command itself.

  • No dispatch record: Check whether the service was active, whether the entry was loaded and valid, whether its location and permissions are correct, whether the host clock reached the scheduled time, and whether the machine was running.
  • Dispatch record present: Cron started the job, so focus on the scheduled account, shell, environment, paths, resource access, and the captured error output.

Debian cron documents its logging flags and syslog behavior, but actual commands, service names, and log destinations vary. Use the host’s own service and logging documentation to retrieve the relevant records rather than assuming a particular command applies everywhere.

8. Follow the evidence to the next check

A practical diagnosis is to compare the scheduled run with the manual run across the dimensions most likely to differ:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Entry: Is the job in the intended user or system crontab, with the correct syntax for that location?
  • Dispatch: Do scheduler logs show that the host started the job at the expected time?
  • Identity and access: Is it running as the intended user, with permission to reach its script, files, credentials, and services?
  • Execution context: Does the command use the right shell, explicit environment, and absolute paths?
  • Timing: Was the host up, and do its clock and timezone match the schedule you expect?
  • Evidence: What do captured stdout, stderr, exit status, cron logs, mail, and script logs show?

If the scheduler never dispatched the entry, debugging the script’s application logic is premature. If dispatch is confirmed, the gap between the scheduled context and the successful manual context is the place to look.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

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

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.