View Full Version : Crontab Command
ResaleBroker
Jul 11th 2004, 7:12 am
I am trying to set up crontab to run a file on my server: http*//www*resalebroker*com/real-estate-books/cronf.php
I am having trouble writing a successful path to that file. Can anyone help?
Home Directory: /hsphere/local/home/resale
CGI Directory: /usr/bin/php -> /usr/bin/php
PHP: .php
Thanks!
compar
Jul 11th 2004, 8:42 am
I haven't got an exact answer for you, but in my experience the best way to find the answer to this question is to try and run the procedure from the command line. When you can make the command execute from there you will have the right path and syntax.
digitalpoint
Jul 11th 2004, 10:18 am
Is your PHP script setup to be able to run from a command line, or just via http?
ResaleBroker
Jul 11th 2004, 11:14 am
Just http.
digitalpoint
Jul 11th 2004, 11:17 am
You would want to use something like curl to execute it from the shell then... for example /usr/bin/curl http://www.resalebroker.com/real-estate-books/cronf.php
ResaleBroker
Jul 11th 2004, 11:50 am
That code didn't work. Any ideas?
ResaleBroker
Jul 11th 2004, 11:53 am
By the way the PHP is cgi-wrapped.
digitalpoint
Jul 11th 2004, 12:47 pm
If your script is designed to work from a shell, you can do /path/to/php http://www.resalebroker.com/real-estate-books/cronf.php
jarvi
Jul 11th 2004, 3:37 pm
Try the following link in the heading Compiled CGI
http://www.htmlcenter.com/tutorials/tutorials.cfm?id=155&type=PHP
Not sure if you have placed the line in cronf.php as it states you need to do in this page. Hope it helps.
Owlcroft
Jul 11th 2004, 9:24 pm
/path/to/php http://www.resalebroker.com/real-estate-books/cronf.phpIn fact, he could use:
/pathtophp/php -q /pathtoscript/cronf.php
The problem is that his host will not tell him (if they even understand the question at their tech-support level) what the correct /pathtophp/ and php invocation are. That sorta makes it a little harder. (Or, putting it another way, knowing those two simple things answers the question.) He has turned in, I believe, five "trouble tickets" so far (the "live support" reports "we don't have documentation on that--turn in a trouble ticket and our experienced technical people will answer your problem instantly", thus providing dictionary makers with new definitions for "answer" and "instantly".)
This should be a heads-up to those who think web hosting is a commodity.
The /pathtoscript/ is no problem; but the other part is, regrettably, a question that--owing to its particularity (what are the path and the PHP invocation on that server)--no one but his host can answer.
ResaleBroker
Jul 12th 2004, 8:39 am
My host server just sent me this message:
"Please, don't run your php scripts in cron. That's not a good idea because it overloads a server." :eek:
Is it me or did I really pick the wrong host?
l0cke
Jul 12th 2004, 9:32 am
Is it me or did I really pick the wrong host?It depends on how often you run the cronjob and how process intensive it is. Most hosts will allow you to run custom scripts/processes during off hours.
ResaleBroker
Jul 12th 2004, 9:50 am
This program would be scheduled to run at 1:00 a.m. in the morning daily. I currently run the program manually every day during peak time.
Owlcroft
Jul 13th 2004, 9:23 pm
It is also noteworthy that the script in question opens a URL, reads the first header line, closes the URL, and exits. Period, the end. Real server-intensive.
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.