CRON scripts to running in seconds interval

 

This problem can be solved with simple bash script. For example, if you need to run a PHP script on every 20 seconds, you can create a bash script like this:
#!/bin/bash
#Name:myscript.sh
#Desc:Run script in every 20 seconds
while (sleep 20 && php /path_to_your_script/your_script_name.php) &
do
wait $!
done
Then, make script executable, and add it to the system startup. That’s all.
Share

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.