Web Hosting Talk







View Full Version : Raq4 cron job


dico
01-05-2002, 03:44 PM
Hi there,

I am not sure if this post should appear here or on a PHP site.

Here goes:

I have a php script that I need run every hour or two. the php script simply gets some info from a database and emails it out.

I read that I should place the following in my crontab

"* * * * * /usr/local/bin/php /home/httpd/html/folder/myscript.php"

Can anyone elaborate on how to do that with a Raq since the cronjob seem to be sorted by directories...

Thanks,

-dr

ffeingol
01-05-2002, 04:23 PM
Well unless you have php compiled as a cgi-bin, that won't work. With a stock install of a RaQ4, PHP is compiled as an Apache module and can't be run on it own.

You could try a script like the following:


#! /bin/bash

/full/path/to/lynx /home/httpd/html/folder/myscript.php


Put that in some file and then chmod the file so it's executable. Then just put the file in /etc/cron.hourly. That will make it run every hour (the easy way).

Frank

CobaltConn
01-05-2002, 04:44 PM
Crontab works for raq....just set it up in a file and type

"crontab [file]" under the user you want it to run under...

ASPCode.net
01-05-2002, 04:56 PM
But it is easy to compile PHP to run as CGI ( and this wont affect the Apache stuff which still run PHP as a module )

wget http://www.php.net/do_download.php?download_file=php-4.0.6.tar.gz&source_site=www.php.net
gunzip php-4.0.6.tar.gz
tar xvf php-4.0.6.tar
cd php-4.0.6
./configure --with-mysql
make
make install

Php is now available here:
/usr/local/bin/php

The configure line might need some tweaking to fit your needs

Asher S
01-07-2002, 02:02 PM
You can always:

* * * * * lynx -d http://your_ip_here/path/file.php

That works for me :D