3 ms·
I 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 cr
by gregjor 6y ago
I 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.