Welcome Guest, Not a member yet? Register   Sign In
Php file run in background...
#1

[eluser]kuysal[/eluser]
Hi;

I have an application which simply gets an rss content and inserts to database. This process must be done periodically every 10 minutes. But I have a shared hosting account and I'm not allowed to run a php file on the server as usual. Is there another way to do this?

Thanks...
#2

[eluser]zdknudsen[/eluser]
Why does it have to be done every 10 minutes? If noone requests it for 30 minutes you've updated twice without reason. You could just check if there has passed more than 10 minutes since last request and then do the update.

Otherwise, I don't think what you want is possible on shared hosting. Unless you make your own computer visit the site every 10 minutes Wink
#3

[eluser]Michael Wales[/eluser]
A lot of shared hostst these days offer ssh access (Dreamhost does, I know). Check just to make sure you can't run a cron job, for sure.

Otherwise, I agree with Zach - just setup a pseudo-cron script.
#4

[eluser]kuysal[/eluser]
Actually I want to build a site that reads the news from multiple rss files and collects them on a single web site. 10 minutes is an example I will find an exact time to update later due to the content of the rss sites and their update periodes. Using my own computer seems to be impossible right now. Big Grin
#5

[eluser]kuysal[/eluser]
Walesmd; can you give more information about ssh?
#6

[eluser]Michael Wales[/eluser]
Who's your web host?

Wikipedia: Secure Shell

It's just the command-line interface on your server but will allow you to establish a Cron job.

Wikipedia: Cron
CodeIgniter Wiki: Advanced Cron Script
#7

[eluser]kuysal[/eluser]
I currently host on godaddy.com but I'm planning to change it.

I'll check the sites
Thanks for help...
#8

[eluser]Rick Jolly[/eluser]
A lot of shared hosts have a cpanel where you can set up a cron job among many other things. Otherwise, there are independent cron service web sites where you can set the url to call and the time interval.
#9

[eluser]kuysal[/eluser]
[quote author="Rick Jolly" date="1189816311"]A lot of shared hosts have a cpanel where you can set up a cron job among many other things. Otherwise, there are independent cron service web sites where you can set the url to call and the time interval.[/quote]

Really? I mean is that a feature of cpanel? Or can you give an example of the company supporting this?
#10

[eluser]Rick Jolly[/eluser]
On my CPanel at lunarpages there is a "Cron jobs" icon. I select it and click "unix style" cron job. Then I enter the scheduling info and the script to run. Like so:
Code:
This is a web interface to the crontab program.
For example, * * * * * would mean every min and 0 0 * * * would mean at midnight.

Minute Hour Day Month Weekday Command
   0    0    *    *      *    php -q /home/myaccount/public_html/admin/cron.php




Theme © iAndrew 2016 - Forum software by © MyBB