agentleFS
youcislayoucisla/Agent-Foundry/skills/core/cron-troubleshoot/SKILL.md

cron-troubleshoot

Skill1 starsChanged 23 days agoMITView on GitHub

'Debug a cron job that failed or didn''t run: timezone, drift, overlap,

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    No log entry → schedule didn't fire (Step 2).

    line 39

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Cron Troubleshoot

A systematic checklist for cron jobs that failed, ran twice, didn't run, or produced wrong output.

Procedure

Seven Failure Modes

ModeSymptomCommon cause
Wrong scheduleRuns at wrong timeTimezone, DST, misread cron syntax
No overlap protectionTwo runs collideSlow previous run + frequent schedule
Missing envFails immediatelyCron env is empty; PATH different
Dependency downFails partwayDB / API / cache unreachable
Silent failureNo logsOutput redirected or discarded
Permission driftFails after deployFile ownership, secret rotation
Clock driftLate by minutesServer NTP not synced

Step 1 — Verify It Ran

grep CRON /var/log/syslog
journalctl -u cron --since "1 hour ago"
crontab -l

No log entry → schedule didn't fire (Step 2). Log entry, no output → silent failure (Step 4).

Step 2 — Verify the Schedule

Common mistakes:

# WRONG — runs every minute of midnight (1440 runs/day)
0 * * * *
# RIGHT — runs at midnight
0 0 * * *

Verify at crontab.guru.

Step 3 — Check Timezone

date && timedatectl && TZ=America/New_York date

Fix: set TZ=... at the top of crontab, or convert to UTC.

Step 4 — Check for Silent Failure

Cron emails output by default. If you don't read mail, failures are silent.

Fix:

MAILTO=""
* * * * * /path/to/job >> /var/log/cronjob.log 2>&1

Or wrap:

#!/bin/bash
exec >> /var/log/cronjob.log 2>&1
echo "=== $(date) ==="
/path/to/real-job

Anti-patterns

  • Assuming the job ran without a log entry.
  • Editing the schedule before checking timezone.
  • Leaving output unredirected.

References

  • details

Verification Checklist

  • Log entry proves whether the job fired.
  • Schedule was decoded against crontab syntax.
  • Timezone and DST were checked.
  • Overlap protection exists for slow jobs.
  • Output is redirected to a readable log.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.