• We had to restore from a backup today after a failed software update. Backup was from 0000 EDT and restored it at 0800 EDT so we lost about 8hrs. Today is 07/20/2024. More info here.

I had an issue recently. Wanting to monitor cron jobs in real-time. Looking for some feedback and/or suggestions please!

veryhungryhippos

New Member
Joined
Jul 25, 2019
Messages
2
Reaction score
1
Credits
0
Hey guys,

I have an issue currently where I've got a cron job set to run at midnight each day to reset daily API requests for a service that I run. The job failed recently which caused me a whole bunch of headaches and I've been trying to find a solution to monitor all of my cron jobs so I don't have a situation like this happen again.

I haven't been able to find a sufficient solution however, and in response I am considering creating a platform that allows you to monitor cron jobs, see logs (and past logs), last run date, failure/success of the last run, etc... in real-time and would notify you if your job hasn't completed within a specified window of time or the job failed.

I believe this might be a pain point and a good solution for others as well.
What are you thoughts? Do you think that this would be useful, have any suggestions, or just think this would be a waste of time?
 


Hi Hungry, and welcome! I'm not a cron user, but Google can answer a lot of questions. How about an email to notify you that your cron job failed? See this link. Another article describes both email and also how to create a custom log so you don't have to dig through syslog... see that article here.

Good luck!
 
Hi Hungry, and welcome! I'm not a cron user, but Google can answer a lot of questions. How about an email to notify you that your cron job failed? See this link. Another article describes both email and also how to create a custom log so you don't have to dig through syslog... see that article here.

Good luck!
Thank you! I suppose I should have done some more thorough googling, I had no idea that you could use MAILTO with cron.

Really looking for a way of streaming logs real-time however and/or get notifications via Slack or SMS. I'll see what I can find!
 
I don't know a lot about Cron either, but if you know what file contains the log info you're wanting, you can use 'tail' to watch it grow in real time. So if 'cron.log' is the log you want to watch type in Terminal, tail -f /var/log/cron.log (may not be correct file name, just an example). the -f is for follow, as in don't exit.
 

Members online


Top