4 ms·
I actually disagree with simplicity. cron does weird things with the environment and it can be hard to correctly reproduce that environment when creating a job
by packetlost 2y ago
I actually disagree with simplicity. cron does weird things with the environment and it can be hard to correctly reproduce that environment when creating a job and debugging. Conversely, systemd timers are very easy to manually trigger and otherwise behave as a normal oneshot service.
- SoftTalker 2y agoMy approach to cron is to assume that you have an empty environment. Just set everything you will need.
- encoderer 2y agoYes this is correct. Something most developers don’t know is that you can set env vars directly in your crontab file.
- encoderer 2y agoI’m the developer of crontab.guru and Cronitor. We have a free tool called CronitorCLI that includes a cron-like shell. You can run and test your scripts in an environment that matches how they will be run by cron itself.
- notepad0x90 2y agoDude! you're my hero! This is why I like HN :) Thank you for many years of reassuring me when I doubted my cron-expressions.
- encoderer 2y agoAs somebody who has made cron jobs my career for the last 11 years, who left a good gig as an engineering director to build a bootstrapped business — that means a lot. It keeps me chugging. Thanks so much.