Logo
Logo
Home
Archive
AI Agent Notes
Advertise
YouTube
Login
Sign Up
Logo
  • Home
  • Posts
  • 🦥Cron For Dummies

🦥Cron For Dummies

Aug 5, 2025

Hello friends!

Welcome to this week’s Sloth Bytes. I hope you had a great week 😃

Yeah I could code a landing page, but why would I?

Even with HTML, CSS, Tailwind, and a few AI tools, it still takes hours to make something that works across screen sizes, has good SEO, and doesn’t look like garbage.

I’m also pretty lazy.

That’s why I like Framer.

Framer still gives me full creative control, but it also has other helpful tools to speed up development so I can go back to building.

When you hit publish, it’s live: SEO-optimized, blazingly fast, and fully responsive.

Need beautiful animations? Just drag a slider or click a button.

A/B testing, a real CMS, one-click localization, and integrations with other software.

Framer has it all.

Yeah I still code, but for landing pages, portfolios, and marketing sites?

I’ll just use Framer and save some hours.

Try it for free and since you’re a Sloth Bytes reader you’ll also get a free month of Framer Pro with code CODINGSLOTH2025.

Cron For Dummies

I always wondered how a lot of apps/programs sent weekly reminders and emails.

Did they manually send it every time?

Well… no obviously. Programmers hate the word “manual” with a passion.

If something can be automated, some programmer will figure it out.

And they did.

Cron has been around on Unix-like systems for decades, and the basic idea is still everywhere: run a command when a schedule says it should run.

What is Cron?

Cron is a time-based job scheduler used on Unix-like systems. A background service reads schedules—commonly stored in crontab files—and starts commands when their scheduled time arrives.

  • Backup databases every night at 2 AM

  • Send reports every Monday at 9 AM

  • Clean up old files every Sunday

  • Check if your website is up every 5 minutes

The name comes from "chronos" (Greek for time). It's literally Father Time for computers.

The Original Cron

Traditional cron uses a compact five-field schedule followed by the command you want to run. The schedule is usually edited with tools such as crontab:

# minute hour day-of-month month day-of-week command
#   |     |       |         |       |
    *     *       *         *       *   /home/sloth/scripts/make_newsletter.sh

# minute:       0-59
# hour:         0-23
# day-of-month: 1-31
# month:        1-12
# day-of-week:  commonly 0-7, where 0 and 7 mean Sunday

This was revolutionary for its time!

Computers could finally do things automatically on schedule. System administrators could go home knowing backups would run at 2 AM without them.

Common Examples

# Every day at 2:30 AM
30 2 * * * /backup/daily-backup.sh

# Every Monday at 9 AM
0 9 * * 1 /send/weekly-report.py

# Every 5 minutes  
*/5 * * * * /check/server-health.sh

The syntax might take a little bit to learn, but check this resource out if you want to play with it:

Crontab.guru

An easy to use editor for crontab schedules.

Why Cron Jobs Matter

  • Repeatable automation: Scheduled jobs don’t depend on someone remembering to click a button.

  • Off-hours work: Run maintenance or batch jobs when traffic is lower—if that actually makes sense for the workload.

  • Periodic checks: Run health checks, cleanup, reports, and other recurring tasks on a predictable cadence.

Modern Alternatives

The cron scheduling idea shows up in plenty of modern systems, but the implementation may be a managed scheduler, workflow platform, serverless trigger, or CI/CD service instead of a Unix cron daemon.

For application workflows, managed schedulers are often easier to observe and operate than a crontab sitting quietly on one server.

  • GitHub Actions scheduled workflows

  • Vercel Cron Jobs

  • AWS EventBridge Scheduler, Google Cloud Scheduler, Azure scheduling services, and similar cloud tools

There’s a lot more options…

The Modern Reality

A lot of modern programs depends on scheduled tasks:

  • Email campaigns scheduled for optimal send times

  • Automated nightly backups protecting critical data

  • SSL certificates renewed before expiration

  • Analytics reports compiled and delivered automatically

  • Security scans running during off-peak hours

When Should You Use Cron Jobs?

Some reasons for cron jobs:

  • Database backups and cleanup tasks

  • Log rotation and system maintenance

  • Sending periodic reports or notifications

  • Health checks and monitoring scripts

  • Data synchronization between systems

The best scheduled job is boring and observable, not forgotten. Log failures, alert when critical jobs don’t run, and think about a few classic cron traps:

  • Environment: cron jobs often run with a smaller PATH and different environment variables than your interactive shell.

  • Time zones: know which time zone the scheduler uses, especially around daylight-saving changes.

  • Overlapping runs: if a job takes longer than its interval, another copy may start before the first finishes.

  • Retries and idempotency: decide what happens after failure and whether running the same job twice is safe.

  • Monitoring: a backup job that silently fails every night is not a backup strategy—it’s performance art.

If you want to keep learning

  • Command line for beginners — the shell basics behind traditional cron and crontab workflows.

  • CI/CD explained — how modern automation pipelines handle scheduled and event-driven jobs.

  • Cloud computing explained — where managed schedulers and serverless jobs fit in modern infrastructure.

Thanks for the feedback!

Introducing gpt-oss

gpt-oss-120b and gpt-oss-20b push the frontier of open-weight reasoning models

Your public ChatGPT queries are getting indexed by Google and other search engines

Search engines are indexing links to ChatGPT conversations that have been made sharable with a link.

Amazon DocumentDB Serverless is now available

Amazon DocumentDB Serverless automatically scales capacity up or down in fine-grained increments based on your application's demand, offering up to 90% cost savings compared to provisioning for peak capacity.

I couldn't submit a PR, so I got hired and fixed it myself

After joining Mintlify (which acquired my previous company), I finally fixed a search bug that had bothered me for over a year as a user.

How Wix Cut 50% of Its Data Platform Costs - Without Sacrificing Performance (Part 1)

In this post, we share the journey of optimizing the data platform at Wix, which led to a 50% reduction in monthly data platform costs.

Thanks to everyone who submitted!

nxrms, HyperUltra96, loonpanda, entenute, AspenTheRoyal, BerryJam8402, RISHI-GAPPIBHAI, gcavelier, shaunak012, RileyWong26, NeoScripter, Suji-droid, and the most interesting one this week a solution in PERL: AI-IS-POWER.

Cinemas

Given an array of seats, return the maximum number of new people which can be seated, as long as there is at least a gap of 2 seats between people.

  • Empty seats are given as 0.

  • Occupied seats are given as 1.

  • Don't move any seats which are already occupied, even if they are less than 2 seats apart. Consider only the gaps between new seats and existing seats.

Examples

maximumSeating([0, 0, 0, 1, 0, 0, 1, 0, 0, 0])
output = 2
# [1, 0, 0, 1, 0, 0, 1, 0, 0, 1] 2 new people were seated!

maximumSeating([0, 0, 0, 0])
output = 2
# [1, 0, 0, 1] 2 new people were seated!

maximumSeating([1, 0, 0, 0, 0, 1])
output = 0
# There is no way to have a gap of at least 2 chairs when adding someone else.

maximumSeating([0, 0, 0, 1, 0, 0, 1, 0, 0, 0])
output = 2

maximumSeating([0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
output = 4

Reply with

  • A link to your solution (github, twitter, personal blog, portfolio, replit, etc)

  • or if you’re on the web version leave a comment!

  • If you want to be mentioned here, I’d prefer if you sent a GitHub link or Replit!

NEW VIDEO!

That’s all from me!

Have a great week, be safe, make good choices, and have fun coding.

If I made a mistake or you have any questions, feel free to comment below or reply to the email!

See you all next week.

What'd you think of today's email?

  • 🦥 Amazing! Keep it up
  • 🦥 Good, not great
  • 🦥 It sucked

Login or Subscribe to participate

Want to advertise in Sloth Bytes?

If your company is interested in reaching an audience of developers and programming enthusiasts, you may want to advertise with us here.

Keep Reading

Read all
arrow-right
envelope-simple

Join 50k+ developers and become a better programmer and stay up to date in just 5 minutes.

© 2026 Sloth Bytes.
beehiivPowered by beehiiv