• We did not send an email asking for donations - please read this post.

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?
 


atanere

Well-Known Member
Joined
Apr 6, 2017
Messages
2,628
Reaction score
2,779
Credits
41
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!
 
OP
V

veryhungryhippos

New Member
Joined
Jul 25, 2019
Messages
2
Reaction score
1
Credits
0
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!
 

TechnoJunky

Well-Known Member
Joined
Dec 3, 2018
Messages
493
Reaction score
390
Credits
314
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.
 
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Linux.org Hosting Donations
Consider making a donation


Top