how to get cron to only send important emails and not every time it runs
you think maybe you should have just used
> /dev/null
and not > /dev/null 2>&1
why is this a full blog post?41–50 of 58 posts
how to get cron to only send important emails and not every time it runs
you think maybe you should have just used
> /dev/null
and not > /dev/null 2>&1
why is this a full blog post?Most of what he's writing about, and much more, is made substantially easier with systemd timers. E.g. want errors to cause e-mails, but everything else to just go to logs? Use a timer to activate a service, and make systemd activate another service on failure. Want to avoid double execution? That's the default (timers are usually used to activate another unit, as long as that unit doesn't start something that double…
I agree: I recently moved my scripts from crontab to systemd timers and there is no going back. Finally I have a proper way to debug and log. Also on NixOS I can have the unit file and timer generated in very few lines. Look at this one for example: "xkcd" = { description = "send latest xkcd comic"; wants = [ "network.target" ]; startAt = "Mon,Wed,Fri *:0/30"; path = with pkgs; [ telegram-cli ]; serviceConfig = { Use…
Is there any good open source distributed scheduler that blends both timer based tasks and event based tasks? Chronos is the only one I'm aware of, but I don't believe it supports event based tasks.
Celery is a task queue that supports scheduling as well, if you're using Python. Backed by several different brokers including Redis.
- Save result as json, which is queryable in the database
- Save enough info in the task result to retry the task from the result.
- Retry a task from its result in Django Admin
- Run a periodic task now (e.g., to test your cron task)
[1] https://github.com/resulto-admin/django-celery-fulldbresult
Nice blog explaining how someone cant use cron. Doesn't mean the rest of us are that incapable.
Take all of the features he mentions, and abstract the to a launch_from_cron.sh file. Make that file accept a script path as an argument and viola! All of the safety added to cron without the need for code duplication or these massive overhead solutions listed in these comments.