Ask HN: How do you make sure all your batch jobs ran?
I have a bunch of command line jobs that run overnight for various hobby projects. They're not connected -- there's about 8-9 that all run independently.
How do you keep track of these? Every once in a while, one of them throws a persistent error. I don't realize it's not running until I see something off about a week later, then I go through the logs and realize it hasn't run since last week.
Is there a best practice to track command line jobs and make sure they ran when they were supposed to run?
I could rig something up, but I thought I'd check to see if this was a solved problem. And, again, these are hobby projects, so an enterprise solution is not what I'm looking for.
2 comments
[ 3.0 ms ] story [ 17.9 ms ] threadAlternatively, you could make the jobs quiet on success and noisy on failure, and just have cron mail you about them? Or make a wrapper script that saves off the status and a status job that mails you if any failed?
It doesn't sound like a scheduling problem - it sounds like a noticing problem. You have to figure out what to do on failure - email, text, retry, log, etc. (Hence the suggestion for Kubernetes, or another declarative automation system like Ansible or Puppet). If "daemon X should be running", checking for it and sending an email is the easiest and most useless response.