Answer the question
In order to leave comments, you need to log in
How does the crontab queue work?
Good afternoon!
Tell me how the cron'a queue works in this situation:
*/1 * * * * curl http://site.ru/index.php?do=parser; /bin/sleep 6; curl http://site.ru/index.php?do=parser; /bin/sleep 6; curl http://site.ru/index.php?do=parser; /bin/sleep 6; curl http://site.ru/index.php?do=parser; /bin/sleep 6; curl http://site.ru/index.php?do=parser; /bin/sleep 6; curl http://site.ru/index.php?do=parser; /bin/sleep 6; curl http://site.ru/index.php?do=parser; /bin/sleep 6; curl http://site.ru/index.php?do=parser; /bin/sleep 6; curl http://site.ru/index.php?do=parser; /bin/sleep 6; curl http://site.ru/index.php?do=parser
Answer the question
In order to leave comments, you need to log in
every minute (at some second, not necessarily at 00 seconds), a script starts executing that looks like
curl site.ru/index.php?do=parser;
/bin/sleep6;
curl site.ru/index.php?do=parser;
/bin/sleep6;
... (total 10 times)
The commands are executed sequentially, hence the first curl is executed, then sleep for 6 seconds, then the next curl is executed.
Curl is not instantaneous, so there will be 6 seconds between two curls + the execution time of the previous curl.
Apparently, the person who wrote this has no idea about cycles and running processes in the background, the command can be shortened to
for var in {1..10}; do sleep 6; curl site.ru/index.php?do=parser;done
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question