I just had to do this last week. In the Linux terminal type:
crontab -e
it will open a blank page in VI. To write in VI, type i for instert. If you want to do a task everyday at midnight type:
0 0 * /usr/local/sbin/php -q /path/to/cgi-bin/your_script.php3
then exit and save (the VI command is escape, :, wq (write quit), enter.
the path to your php binary (/usr/local/sbin/php) may be different for you. Type locate php on the command line and look for a similar location. Also, make sure that you put your script in the CGI bin.
here's a good crontab read:
http://www.jimmo.com/Linux_Tutorial/Basic_Administration/Misc/cron.html