All Topics
All Topics
Technology
Technology
Design
Design
Programming
Programming
Science
Science
News
News
Gaming
Gaming
Entertainment
Entertainment
Business
Business
Finance
Finance
Sports
Sports
Health
Health
Food
Food
Travel
Travel
Art
Art
Music
Music
Books
Books
Education
Education
Politics
Politics
Personal
Personal
No algorithm. No AI slop. No ads. Just RSS. Pro-human. Indie writers. Real journalism. Open web. Chronological. Hand toasted.

Making Cronjobs More Dynamic with Wrapper Scripts

By

0928374082

5mo ago· 4 min readen

Summary

The article discusses a technique for making cronjobs more dynamic and flexible by using wrapper scripts that can conditionally execute tasks based on various criteria. The author shares their experience with cronjobs since the early 2000s and explains how while cron is powerful for scheduling recurring tasks, it lacks dynamic decision-making capabilities. The solution presented involves creating wrapper scripts that check conditions before executing the actual task, allowing for more intelligent scheduling like running tasks only on specific days, during certain hours, or based on system conditions.

Key quotes

· 4 pulled
I remember learning about cronjobs in the early 2000s. I could tell the computer to go do something, on a recurring basis, forever, even when I wasn't there. They felt like magic!
But while you could do fun, complex specifications of recurring intervals, you couldn't quite specify something quite as dynamic as 'run this script every Tuesday at 7am unless it's the last Tuesday of the month'
The trick is to use a wrapper script that checks some condition before deciding whether to run the actual task
This approach gives you much more flexibility than cron alone can provide
Snippet from the RSS feed
A fun trick for making crontab tasks a little more flexible and dynamic

You might also wanna read