Skip to content

Cron Job

Medium — good to knowBackend

ELI5 — The Vibe Check

A cron job is a task that runs on a schedule automatically. 'Every day at midnight, clean up old sessions.' 'Every hour, send digest emails.' It's like setting an alarm for your code — at the specified time, it just runs.

Real Talk

A cron job is a scheduled task that runs automatically at specified time intervals, defined using cron syntax (e.g., 0 * * * * for every hour). Named after the Unix 'cron' daemon. Used for routine maintenance, report generation, cache warming, and periodic data processing.

Show Me The Code

// Every day at midnight: 0 0 * * *
// Every hour:           0 * * * *
// Every 5 minutes:      */5 * * * *

// Node.js with node-cron
cron.schedule('0 0 * * *', () => {
  cleanupExpiredSessions();
});

When You'll Hear This

"Set up a cron job to send weekly digests." / "The cleanup cron runs every night at 3 AM."

Made with passive-aggressive love by manoga.digital. Powered by Claude.