- Sloth Bytes
- Posts
- đŠ„Cron For Dummies
đŠ„Cron For Dummies

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.
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.
Yeah I still code, but for landing pages, portfolios, and marketing sites?
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.
They created Cron and Itâs been running millions of automated tasks since 1975.
What is Cron?
Cron runs commands automatically at specified times:
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
Cron started off as a shell command that uses an interesting syntax to define when tasks should run.
* * * * * /home/sloth/scripts/make_newsletter.sh
# | | | | |
# | | | | day of the week (0â6) (Sunday to Saturday;
# | | | month (1â12) 7 is also Sunday on some systems)
# | | day of the month (1â31)
# | hour (0â23)
# minute (0â59)
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:
Why Cron Jobs Matter
Humans forget, computers don't.
Off-hours automation: Run heavy tasks when users aren't active.
Consistent monitoring: Health checks and alerts that never sleep.
Modern Alternatives
Cron has evolved over the years to the point where a lot of tools do it automatically for you!
But if you need to do custom workflows/cron jobs you can do that with modern tools instead of using the shell.
GitHub Actions
Vercel
AWS, Google Cloud, Azure, etc
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 cron job is one you set up once and forget about, until you desperately need the results it's been quietly producing.


Thanks for the feedback!



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? |
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.
Reply