I was looking for a way to continuously run a PHP script every 15 seconds online, so that I may manage some accounts using an API. I was able to find a script that satisfies what I was looking for as follows:
#!/bin/bash
#This script runs every 15 seconds
#This script is ran in /etc/rc.local (startup)
while (sleep 15 && php test.php) &
do
wait $!
done
This script works perfectly and runs every 15 seconds. However, now I want to modify the script such that it may
- do what the script is already doing
- run a second script, every 5 minutes
Is there a way to modify the current while loop so that I may achieve this? Thanks!