Posted by dabbler (leah), 23 January 2004Hi,
I've been venturing into the crontab arena a bit, I have a stats application that I need to run daily to purge the server access log file.
In telnet, I edited my crontab via:
I braved vi, (with a vi command listing in an alternate window ) and I have this in my crontab listing:
Now I have gotten an email with a cron error message, stating no such file or directory. I am absolutely certain of the path. Is it the update value foiling my task?
Posted by admin (Graham Ellis), 24 January 2004Basically, yes, the update value is fooling it as you suggest. After the last of the five values, you need a space followed by the command you would run at the command line, which is the name of the program followed by a space followed by other parameters. The ?name=value notation is the way that information is passed into a script when it's run via CGI and a web page not how it's done from the command line ....
If the script you're trying to run has been written for command line use as well as CGI use, you'll probably find separate help documentation telling you how to run it from the command line ... if not, it's likley that you'll need to do some work on the script if you want to use it via crontab.
The best way to test a job that you will be running in crontab is to type the line (minus the five time fields) at the command prompt in telnet and make sure it works there ... then you're not into a cycle of crontab edit / wait.
One other gem with crontab - ensure you don't have any blank lines in the file you're editing. If you do it can cause problems.
Posted by dabbler (leah), 24 January 2004on 01/24/04 at 04:36:28, Graham Ellis wrote:
Ah-ha, made perfect sense and I've found the command line portion of the documentation. Fixed that, and it still wasn't happening....
Well there ya go, that sorted it right out.
Thank you for that tip as well. Now that I'm more comfortable with cron, I won't hesitate to use it for other things if it can make my life simpler.
Have a great weekend sir.
Posted by admin (Graham Ellis), 24 January 2004on 01/24/04 at 13:11:28, leah wrote:
Ooh - that's far too formal - always makes me slightly nervous to be called "sir" rather than "Graham". Perhaps a Brit thing?
Glad we got crontab sorted. Have a good weekend too ... greetings from Minneapolis / St Paul airport [Don't ask ]
Posted by dabbler (leah), 25 January 2004on 01/24/04 at 21:29:01, Graham Ellis wrote:
Purely a strong respect for superior knowledge Graham.
PH: 01144 1225 708225 • FAX: 01144 1225 899360 • EMAIL: firstname.lastname@example.org • WEB: http://www.wellho.net • SKYPE: wellho