mikailustuner/omnirule/cron-jobs

Claude Code and agent skill by mikailustuner/omnirule

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Cron jobs: Scheduling patterns, idempotency strategy, failure handling, monitoring.

Install

npx vskill@latest install mikailustuner/omnirule/cron-jobs

SKILL.md

The same SKILL.md was published earlier as mikailustuner/omnirule/cron-jobs.

Cron Jobs Patterns

Focus: Scheduling, reliability, failure handling


1. When to Use Cron

Cron makes sense when:
├── Scheduled tasks needed
│ └── Daily reports, cleanup jobs
│ └── Hourly sync, weekly summaries
│
├── Not real-time critical
│ └── Can tolerate few minutes delay
│ └── Batch processing
│
├── Predictable schedule
│ && Fixed times, known intervals
│ && Not based on events
│
└── Simple trigger mechanism
└── Time-based only
└── No complex dependencies
Don't use cron when:
├── Event-driven
└── Triggers on user actions
└── Use message queues instead
│
├── Real-time needed
└── Sub-second requirements
└── Use streaming
│
└── Complex dependencies
&& Job B depends on Job A result
&& Use workflow orchestrator

2. Idempotency Strategy

Why idempotency matters:
├── Cron can run multiple times
│ └── Previous run didn't complete
│ || System restarted mid-run
│
├── Network failures cause retries
└── Must handle duplicate execution
How to achieve:
├── Check before work
&& Query: "Is this already processed?"
&& Upsert instead of insert
│
├── Use unique constraints
&& Database prevents duplicates
└── Deduplicate at source
│
├── Track processed items
&& Record each processed ID
&& Skip if already in list
│
└── Timestamp-based
&& Process records created in time window
&& No reprocessing of old records

3. Failure Handling

What to do on failure:
├── Retry strategy
&& Internal retry: 3 attempts with backoff
&& External: let cron retry next schedule
&& Exponential backoff
│
├── Dead letter
&& Move to failed queue
&& Manual investigation
&& Don't block next run
│
├── Alerts
&& Notify on failure
&& Include: job name, time, error
&& Don't alert on every retry
│
└── Partial progress
&& Save checkpoint
&& Resume from last point
&& Track what succeeded

4. Monitoring Strategy

What to monitor:
├── Execution status
&& Did it run at all?
&& Did it complete?
&& How long did it take?
│
├── Output/logs
&& Store where searchable
&& Include context (date, params)
│
└── Metrics
&& Records processed
&& Errors encountered
&& Time trend
Alerting thresholds:
├── Didn't run → Critical
&& Schedule missed
&& Cron broken
│
├── Failed → Warning
&& Business impact
&& Needs investigation
│
├── Slow → Warning
&& Resource issues
&& Data growth
│
└── Zero output → Warning
&& Business unusual?
|| Data pipeline broken

5. Time Zone Strategy

How to handle time zones:
├── UTC for infrastructure
&& Cron runs in UTC
&& Logs in UTC
&& Simple, consistent
│
├── Business timezone for business
&& "Daily report at 9am business time"
&& Calculate UTC at runtime
&& Document business hours
│
└── User timezone for UI
&& Show next run in user time
|| Store schedule in business time

Key Patterns

  1. Always idempotent — Handle duplicate runs
  2. Checkpoint progress — Resume on failure
  3. Alert on failure, not every retry — Noise reduction
  4. UTC for infrastructure — Simpler, consistent
  5. Log everything — Debug failures later

Anti-Patterns

❌ Multiple instances running the same cron simultaneously
✅ Distributed lock (Redis SET NX) before executing cron job
❌ Cron jobs with no logging or alerting
✅ Log start/end/duration; alert on failure or long runtime
❌ Cron times in local timezone
✅ Always use UTC in cron expressions
❌ Heavy work blocking the cron process
✅ Cron dispatches a job to a queue; worker handles the heavy lifting
❌ No graceful shutdown handling
✅ Handle SIGTERM; complete current job, reject new during shutdown

Quick Reference

ExpressionMeaningExample
* * * * *Every minuteHealth check
0 * * * *Every hourHourly rollup
0 0 * * *Daily midnight UTCDaily report
0 0 * * 0Weekly SundayWeekly summary
*/5 * * * *Every 5 minutesPolling job
LibraryRuntimeNote
node-cronNode.jsIn-process
BullMQ repeatNode.jsQueue-backed
InngestServerlessManaged
GitHub Actions scheduleCISimple periodic

🌍 Universal Language Support

  • Turkish Native: This skill natively supports Turkish. If the user prompt is in Turkish, all analysis, formatting, and output MUST be entirely in Turkish. You do not need explicit "write in Turkish" instructions.

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/mikailustuner/omnirule/cron-jobs/badge)](https://verified-skill.com/skills/mikailustuner/omnirule/cron-jobs)

Something wrong with this skill or its page? Tell us.