PDA

View Full Version : Baffled by Cron Job


Slider
12-15-2004, 12:41 PM
I have probbaly read every post in the forums about cron jobs and still havnt a clue how to get it working .

this is the output I get

/home/slider/www/web/admin/spider.php: ?php: No such file or directory
/home/slider/www/web/admin/spider.php: /bin: is a directory
/home/slider/www/web/admin/spider.php: --------------------------------------------------------------------------------: command not found
/home/slider/www/web/admin/spider.php: PhpDig: command not found
/home/slider/www/web/admin/spider.php: This: command not found
/home/slider/www/web/admin/spider.php: See: command not found
/home/slider/www/web/admin/spider.php: All: command not found
/home/slider/www/web/admin/spider.php: PhpDig: command not found
/home/slider/www/web/admin/spider.php: --------------------------------------------------------------------------------: command not found
/home/slider/www/web/admin/spider.php: logs/: is a directory
/home/slider/www/web/admin/spider.php: //---------------spider: No such file or directory
/home/slider/www/web/admin/spider.php: //---------------operates: No such file or directory
/home/slider/www/web/admin/spider.php: line 14: syntax error near unexpected token `time()'
/home/slider/www/web/admin/spider.php: line 14: `$debut = time();'

Charter
12-15-2004, 10:04 PM
http://www.phpdig.net/forum/showthread.php?t=323

Slider
12-15-2004, 10:34 PM
I have an excellent hosting company I go through. They have been able to answer every question I have ever had except when asking what the path was to php. I was told I wouldn't need to know it. After trial and error I finally found the path to be /usr/local/bin/php .

For my next hair pulling experience I was having trouble with $relative_script_path being correct in config.php and spider.php
I fixed that problem and most likely not the right way by replacing the $&$^* (excuse my language) $relative_script_path variable with a real path.
Sure wish I knew why it didn't like the '..' that was being set for $relative_script_path.

....Anyways it now works like a charm. If my host could have told me the path to php in the beginning it might not have taken as long. Since this is my 1st experience with cron jobs I assumed they knew what they were talking about.

My final cron line ended up as the follwing...
/usr/local/bin/php -f /home/user/www/web/admin/spider.php /home/user/www/web/admin/cronlist.txt
it would not allow me to simply use cronlist.txt without a path

Hope this helps anyone who had to go through what I did.

I do very much appreciate your reply. You have one very great script you have written. Keep up the great work. :)