Jump to content

Scheduled task


Recommended Posts

Hi guys,

 

I have a PHP file, that needs to be called evry 2 mins, to check to see some external servers data has been updated.

 

Eg. The following file needs to be called, dataupdater.php with some parameters.

 

mywebsite.com/dataupdater.php?item=1

mywebsite.com/dataupdater.php?item=2

mywebsite.com/dataupdater.php?item=3

mywebsite.com/dataupdater.php?item=4

mywebsite.com/dataupdater.php?item=5

mywebsite.com/dataupdater.php?item=6

 

If the data is updated I update my DB.

 

Could some please tell me the best way of calling "dataupdater.php?item=6" ie. should it be a daemon thread, Cron job, WGET etc.. or should I create a PHP file, containing a thread, which sleeps for 2 minutes then calls dataupdater.php??

 

The file to be called is stored locally, but has will connect to some external XML file to check if the data status.

 

I want something that is efficicient, fast and relaiable.

 

Hope this question makes sense

 

thanks in advance for your thoughts,

 

Will

Link to comment
https://forums.phpfreaks.com/topic/156581-scheduled-task/
Share on other sites

Well, basically what Im trying to achieve is, every few minutes oto check if some external XML file has been updated, if it has, I take the "new data" and store it in my database.

 

Hence why I would like to call some local PHP file, that will do the checking.

 

I'd say there's around 150 XML files to be checked every 30 minutes. The script that runs is the same, the varible iten "dataupdater.php?item=6" dictates which XML file to check.

 

Whats the best way of doing this?

 

Thanks for your help thus far

 

Will

 

PS: I have a dedicated host, which goes some way in giving me flexiibility as to my method of coding this.

Link to comment
https://forums.phpfreaks.com/topic/156581-scheduled-task/#findComment-824639
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.