|
|
|
|
|
by twic
4443 days ago
|
|
Really interesting! It would be great if the readme could go into more detail about how the relationship between the hub, CLI, and cron works, including an explicit description of what text goes in the crontab files. How do you get the reports of each run back to the hub? Are you wrapping each cronned command in a script which captures the output? Does the hub have its own notion of what jobs exist on each machine? If so, there is the potential for this to get out of sync with what's really on the machine (manual editing of crontab, database crash and restore from an old backup, etc). Is there any way to detect that, and bring them back into sync? Can the hub form an opinion on whether any job has failed to run when it should? Can that be exposed to something like Nagios? How do i integrate this with rcron for my highly available cronjobs? Have you thought about supporing sqlite for a database? It would simplify deployment considerably in simple cases. |
|
Yeah, so to convert a cron that ran `ls` to use minicron you would change it to `minicron run ls`. Currently the full command that gets added to the crontab is something like `/bin/bash -l -c 'minicron run ls'`, I use /bin/bash -l so it's easier to get working when you are using something like rvm for managing ruby versions. The command then gets run by minicron in a pseudo terminal so I can capture output line by line or even character by character and send it on.
At the moment the hub only knows about jobs which you create via it or for when you first run a job it gets created, so if you ran `minicron run ls` manually from server1 a job called ls on server1 would be stored in the db. Currently there is a potential for them to get out of sync yes, I had some ideas about how a push/pull type sync feature could work but I ran out of time to work on it. It's definitely something I want to improve in the future though!
Yeah, so the hub knows about any 'schedules' i.e cron expressions that you set up from it, so if you set up a schedule of '* * * * *' i.e every minute and that cron doesn't execute every minute it will send an alert via email/sms/pagerduty if you have enabled them. It does this by polling the database for executions in the background. I'm sure a way to expose those alerts to Nagios could be added.
I hadn't heard of rcron, I will have to look into that.
Yes and I agree! I did have SQlite support at one point but I dropped it because I was using triggers for cascading deletes, I'm not doing that anymore though so it should be possible to add it back pretty easily.
Thanks for your thoughts!