Loading Web pages with Cron Jobs

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
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?

Re: Loading Web pages with Cron Jobs


smallfrythetall@gmail.com wrote:

Quoted text here. Click to load it

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

/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

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:PASSWORD@www.example.com/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.


Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://pink.odahoda.de /

Site Timeline