There is a PHP script I would like to execute by a cron-job but it has to be executed every seconds or every 2 seconds. (PHP file updates the cover photo of a page via opengraph)
So I decided to write a shell script which is below. But how does php act when executed by a shell script, is it works normally like requested from a browser or what happens ? Does sessions works ?
#!/bin/bash
while true; do
/path/to/file.php
sleep 1
done;
echo "Stopped" | mail -s "Cron script has stopped." [email protected]