Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I was annoyed by cron/fcron limitations and figured systemd is the way go because of its flexibility and power, but also was annoyed about manually managing tons of unit files. So I wrote a tool with a config that looks kinda like a crontab, but uses systemd (or launchd on mac) behind the scenes: https://github.com/karlicoss/dron#what-does-it-do

E.g. a simplest job definition looks like this

  job(every(mins=10), 'ping https://beepb00p.xyz', unit_name='ping-beepb00p')
But also it's possible to add more properties, e.g. arbirary systemd properties, or custom notification backends (e.g. telegram message or desktop notification)

Since it's python, I can reuse variables, use for loops, import jobs from other files (e.g. if there are shared jobs between machines), and check if it's valid with mypy.

Been using this for years now, and very happy, one of the most useful tools I wrote.

It's a bit undocumented and messy but if you are interested in trying it out, just let me know, I'm happy to help :)



This looks pretty interesting! I'll try it. I have added a link to dron and to your "In search of a better job scheduler" post (https://beepb00p.xyz/scheduler.html) to https://dbohdan.com/fcron#see-also.

I recommend the post. It covers pros and cons of fcron, systemd timers, and other alternatives to cron.


Since parent is talking Python, I resort to APScheduler whenever I need cron-like features.

https://apscheduler.readthedocs.io/en/3.x/modules/triggers/c...

`sched.add_job(job_function, 'cron', day_of_week='mon-fri', hour=5, minute=30, end_date='2014-05-30')`

Sometimes also `schedule` https://github.com/dbader/schedule

`schedule.every(5).to(10).minutes.do(job)`




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: