Jump to content

Run update script every 24 hours


raimis100

Recommended Posts

Hi!

 

I can't use cronjobs on my server so I decided that my update script could be run by my sites visitors.

 

Now I am trying to figure out how.

 

Idea was to get system time every time the visitor opens the page and If more than 24 hours are passed then run script.

 

The update script would save time when it has run on text file.

 

I am php newbie so I need some help here.

I am also looking at the php time functions now to figure out how to do it.

Link to comment
https://forums.phpfreaks.com/topic/121098-run-update-script-every-24-hours/
Share on other sites

I took a look at php tuts

 

Here is what I can think of :

 


  If (date("z") > file_get_contents ('updatetime.txt')) 
  {
    Update;
    $fp = fopen('updatetime.txt', 'w');
    fwrite($fp, date("z"));
    fclose($fp);
  }

 

Do you have a better idea ?

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.