openmic.social is an uncensored community. You may encounter strong language, controversial opinions, and mature or NSFW material. You must be 18+ to browse. Illegal content is prohibited and removed on sight — please report it. By continuing, you accept that you may see content you personally disagree with.
My favourite - and I’ve gotten into arguments with people about this who clearly never just tried it to see what happens - is it never executes things with the shell you think it will.
So many people assume that just because their script says
#!/bin/bashat the top that cron is going to run it in bash. The reality is without ALSO settingSHELL=/bin/bashin the crontab file, you’re getting your system’s lowest-common-denominator shell (ash/dash/sh/whatever other gross abomination).So much time wasted debugging. And I’m generally pretty good at avoiding shell-specific syntax, I’ve seen the abominations of shell scripts some people write.
The one thing I do wish systemd timers offered is cron syntax backwards compatibility, rather than just its ISO8601-style time patterns. An every-5-minutes job that used to be
*/5 * * * *is nowOnCalendar=*-*-* *:0/5:0and I’m just not sure that syntax is universally an improvement.