Cron job tutorial to run cron_admin.php
Welcome to the wonderful world of cron.
Quick definitions...
'cron' is the unix tool that runs a 'cron job'. It activates every minute to run whatever jobs exist in the 'crontab' (cron table). Mainly you will have access to the crontab and can set jobs to be run.
I am lucky that my host provides an idiot's tool to cron jobs (cron job manager) but it's not that hard to set it manually. I advise doing a google search for a tutorial on cron jobs.
Some sample tutorials are:
http://www.webmasters-central.com/t/cron.shtml
http://www.4webhelp.net/tutorials/misc/cron.php
http://www.adminschoice.com/docs/crontab.htm
NB: if your ISP doesn't allow you to have a cron tab you could try these services:
http://www.webcron.org/index.php?&lang=en
http://www.cronjobs.org/subscribe.php
http://www.webbasedcron.com/
You want to call the include/cron_admin.php file just as if you were clicking on a link in a web browser. You can do this in different ways but I use lynx which is a command line unix (text) web browser.
Here's my crontab entry
0 16 * * * lynx -dump http://your_server/path/include/cron_admin.phpThe first 2 numbers mean that this particular job runs at 16:00. The following 3 *s mean that it runs each date of every month and on every day of the week. As lynx exists in my root I call this without a path but you may require a path. The switch -dump means that the page output is dumped to cron. As the output from my cron jobs is emailed to me this means I get an email summary of ladder/challenge status each time the job runs. The URL follows on and needs to point to where you have the cron_admin.php file stored. You could move it elsewhere if you wished.
So this will run my admin script at 4pm each day. I also run it at midnight and 8am to keep all the challenges tidied up.
There are various tools to make this easier to understand/run e.g.
http://www.clockwatchers.com/cron_tool.html
http://www.bitfolge.de/pseudocron-en.html
on windows: http://www.visualcron.com/
Matt
I had to add the -cookies switch to the command line, which seems to work.
I have never thought about closing lynx. I really don't know this for sure but I wonder if running it as a command line with a URL actually closes the program automatically.
I also get asked about cookies if I run lynx manually but I have found that running lynx in the cron job does not require me to set a cookie switch - it just seems to work anyway! Incidentally, where did you find the -cookies switch documented?
Matt
Cant remember exactly where I found the cookies switch, I just did a google search. There is an option in lynx but for some reason, mine wont save the cookies option, hence i used the cookies switch.

OK, i have imported the three lines into cron, but I have a couple of questions:
Firstly when I use lynx manually on the command line it asks if i want to accept cookies. Presumable I need to turn this off somehow
Also, how does cron know when to quit lynx?