I am trying to execute a basic script on my server to automatically run a PHP script every 45 seconds through Python:
import os
import time
while(1):
os.spawnl(os.P_NOWAIT, "twitter_clean.php")
print "checked twitter"
time.sleep(45)
The PHP is checking twitter, processing some values and adding them to a DB. The script seems to loop fine, but doesn't seem to be calling/executing the PHP...is os.spawnl(os.P_NOWAIT, "twitter_clean.php")
the right command?
Also, once I execute the Python through terminal, will it keep running if I close my SSH session with the server?