I have a rss feed (xml) that is updated frequently. I need to send notifications to APNS if new update is avaliable on rss feed (xml). So far I know I can parse xml with php and send the result to APNS with my local Apache Server on Mac (MAMP).
But I do that by simply entering php xxx.php command on terminal window.The File xxx.php first parses the xml file and then sends the results to the APNS server.
My question is
How can I periodically run this php file on a server?
Do I need a Virtual Private Server?
If so what is the code or function for running a php file continuously or every 10 mins ?
You can use
cronon a linux/mac server to run periodically any command (for example:php xxx.php)I) In a command prompt you can edit the
crontabwith:crontab -eII). At the end you add a line for every script you want to run periodically. Each line must follow this pattern:
For example if you want to run the script every hour you add this line:
III) Then exit with
CTRL+Xand save.More examples on Wikipedia.