Loading Web pages with Cron Jobs

S

smallfrythetall

Ok, I run a online browser based game, and I need to do nightly resets
(revives everybody and some other things) and they only think I have
for that is Cron jobs. I wrote a .php file that updates my database
when loaded. need to get it to load automaticly...any help?
 
B

Benjamin Niemann

Hello,

Ok, I run a online browser based game, and I need to do nightly resets
(revives everybody and some other things) and they only think I have
for that is Cron jobs. I wrote a .php file that updates my database
when loaded. need to get it to load automaticly...any help?

If you have full (SSH) access to the (Linux/UNIX) server, you can use the
CGI version of PHP to run the script directly, something like a file

#!/bin/sh
/usr/bin/php /path/to/script.php

in /etc/cron.daily/
'man cron' will give you more details for your specific system.

The script should then either be password protected (so other people cannot
run it) or be outside of the document root.

If your access to the server is limited (e.g. shared host), you might have
some kind of (web)interface to setup cron jobs (this depends on your
hoster).

If the CGI version of PHP is not available, you could also use wget/lynx/...
to run the script on the webserver, e.g.:

wget http://LOGIN:[email protected]/path/to/script.php

This will also work, if you cannot setup cronjobs on the webserver itself,
but on a machine at home/office/...

If you are talking about Windows systems... Sorry, cannot help you then.


Greetings
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top