Answer the question
In order to leave comments, you need to log in
How to run a script/url via crontab that takes a long time (20-25 minutes)?
I create an entry in crontab
* */6 * * * /usr/bin/wget -q -O- http://my-site/my_url
Answer the question
In order to leave comments, you need to log in
0 */6 * * * /usr/bin/wget -q -O- http://my-site/my_url
LOCK_FILE=/tmp/wget.lock
* */6 * * * /usr/bin/wget -q -O- http://my-site/my_url
First, run it through the CLI. Through http, too many people can kill it by timeout, from wget to web servers.
Secondly, add a check with a limit on the number of running processes to the script code. Classically, this is implemented through a pid file.
Maybe as an option just make the cron run for a longer time (although you have a hardened script apparently) ?
Well, and so - keep in the database or file a variable responsible for the state of the script, and do not start it on a new one if it is available.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question