4 ms·
I also agree that most developers are easily able to set up a cronjob locally. However, cronjobs may easily fail to start or may not finish on time. In the futu
by jventura 6y ago
I also agree that most developers are easily able to set up a cronjob locally. However, cronjobs may easily fail to start or may not finish on time. In the future I would like to add a way for users to add retries, timeouts, and grace periods for completion, or else they get alerted.
The guy(s) at https://healthchecks.io/ https://healthchecks.io/ do the job of monitoring the job completion but do not trigger the job itself. I'm looking to see if someone has both the needs (to start the job, and to check its completion)..
> If this service can send requests to run scripts anyone can send the same request.
I thought of that. A easy fix would be to send a token in the url query, and validate that token in the user's webapp's view..
Thanks for the feedback!
- gregjor 6y agoI don't experience problems with cron itself failing to start jobs, but it doesn't have any monitoring built-in. Solutions exist for that, including wrapping cron scripts to notify or log when they start and stop. Implementing retries, timeouts, etc. for jobs you initiate remotely over HTTP GET requests, and using a token for validating access, seems like a lot more integration at the customer side than just using cron. Enforcing timeouts, or preventing them, means changing the web server (Apache) and runtime system (e.g. mod_php) to allow a process to run for longer than the default time. If I have access to Apache and PHP config I also have access to the crontab. I use cron with HTTP GET requests locally, run with curl so I can set a timeout and capture the output. Apache restricts those requests to localhost, so they can't get initiated remotely. I have a simple wrapper that logs when jobs start and finish, and a monitoring page that shows last run time and success/fail status. Every job has an associated estimated time it should run so the monitor can show jobs that ran too long.