Jump to content

Host doesn't support Cron Jobs... what to do?


interpim

Recommended Posts

Well, what I want to do is, run a script once every say, 30 minutes... basically run through a script and process every row in my database.  Well... I figured a Cron Job was the easiest way to go about this... but my host doesn't support it at the moment.  Is there any other way to get a script to run automattically without user intervention on a set time schedule?

Link to comment
Share on other sites

If your site is accessed regularly, you can have some code that runs every time your site is accessed.  This code will check when your job was run last, and run it again if it was run more than 30 minutes ago.  That will give you an "at least 30 minutes" job.

 

Alternatively, you can run the cron job somewhere else and have it hit a script on your site every 30 minutes.  That script can do the work.

Link to comment
Share on other sites

well... what I am doing is making a little game in php...

 

basically I want to give all the users x number of turns every x number of minutes...

 

The site isn't really accessed often enough to rely on someone to log in to call the script... so I am not sure what will work that will give everyone a fair amount of turns. 

 

I was thinking of taking a timestamp everytime a user used a turn, then next time he loads a page i would call a function that would check current time against his last turn time and increment it 1 time for every x amount of units went by since that timestamp... but that limits me to setting it off of their time they used the turn... not every 15 minutes which is what I would like to do.

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.