Through Cron I let the script every minute (more often it is impossible, you know yourself). How can you speed up this process? The script is executed on the hosting, there I can only select the timing and that's it.
2 answers
Maybe then you should think about this issue from the script itself, for example in PHP there is sleep, you can simply do a delay in the loop, while allowing the script to work without a client and then you will not have to call it through the CLI. It will be necessary unless to configure the server. Do you need to clarify what your task is?
- That's about the "work without a client" is interesting, but how do I set up the server? :) - PiT
- I have no idea, I do not know what your server is. But working without a client is also possible by the command
user_ignore();- Evgeny Ivanov
|
Run the task every 30 seconds
*/1 * * * * root /home/mybin/script.sh; /bin/sleep 30; /home/mybin/script.sh Run the task every 20 seconds
*/1 * * * * root /home/mybin/script.sh; /bin/sleep 20; /home/mybin/script.sh; /bin/sleep 20; /home/mybin/script.sh Run the task every 15 seconds
*/1 * * * * root /home/mybin/script.sh; /bin/sleep 15; /home/mybin/script.sh; /bin/sleep 15; /home/mybin/script.sh; /bin/sleep 15; /home/mybin/script.sh - Well, you are a clever sir) Only if script.sh is not executed instantly, the delay will go a little longer than 30/20/15 seconds - andreymal
- @andreymal, it all depends on the script, if the race of states does not arise, I don’t see any problems. He will start a separate process like a separate process. - Ordman
|