XeroXer Posted November 9, 2006 Share Posted November 9, 2006 Is it possible somehow to create a php script that runs on certain times every day.I am planning on making a script that reads stats from two sites for later comparresing.Reads the data and stores it in either my database or a textfile.I want it to read and save the data three times a day and automaticly.Anyone got any tips on how to do this? Quote Link to comment Share on other sites More sharing options...
Caesar Posted November 9, 2006 Share Posted November 9, 2006 You need to setup a cronjob to do that. You need to check with your host to see if they alow it. Quote Link to comment Share on other sites More sharing options...
XeroXer Posted November 10, 2006 Author Share Posted November 10, 2006 Can I see that in the phpinfo or do I have to ask them?And if they do not allow it I can't do it?Anyone know any free hosting site who allows it?I don't wanna print the info out anywhere I just want it stored in a textfile for further use by me... Quote Link to comment Share on other sites More sharing options...
Vikas Jayna Posted November 10, 2006 Share Posted November 10, 2006 Cron jobs are a feature of linux and not php. It allows you to schedule any command in linux. Quote Link to comment Share on other sites More sharing options...
XeroXer Posted November 10, 2006 Author Share Posted November 10, 2006 oh... :-(So there is no way to do a timed event like this just through php?Or any other way you can suggest?Because I really need to make this automaticly. I can't sit three times a day every day writing down ite statistics... Quote Link to comment Share on other sites More sharing options...
Vikas Jayna Posted November 11, 2006 Share Posted November 11, 2006 One way is to put a check in each of your scripts or probably the home page by putting some checks on the current system time and whether the thing has been logged. This approach is used by the software available at http://www.dwalker.co.uk/phpjobscheduler/But the time at which the data will be logged will be different every day as it will depend on when a page is requested on the website and hence this method will not work for sites which have only a few hits a day Quote Link to comment Share on other sites More sharing options...
marknt Posted November 11, 2006 Share Posted November 11, 2006 Thanks vikas for the link Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.