PDA

View Full Version : Crontab


Joe-Montana
24th October 2005, 00:46
Have a simple file called my_webstatic.run

In that file is:
----------------

webalizer /var/log/httpd/access_log -o /var/www/html/webstatic/

-------------------


Now i want crontab to run it:
---------------------------------

05,10,15,20,25,30,35,40,45,50,55 * * * * /var/www/html/webstatic/my_webstatic.run -nice 19 /dev/null 2> /dev/null

This do not work, but when i run it like this everything is fine:


[root@localhost /]# webalizer /var/log/httpd/access_log -o /var/www/html/webstatic/
Webalizer V2.01-10 (Linux 2.6.11-6mdk-i686-up-4GB) English
Using logfile /var/log/httpd/access_log (clf)
Creating output in /var/www/html/webstatic/
Hostname for reports is 'sohigh.dk'
Reading history file... webalizer.hist
Error: Skipping oversized log record
Warning: Truncating oversized request field
Warning: Truncating oversized referrer field
Warning: Truncating oversized referrer field
Warning: Truncating oversized request field
Warning: Truncating oversized referrer field
Warning: Truncating oversized request field
Warning: Truncating oversized referrer field
Warning: Truncating oversized referrer field
Warning: Truncating oversized request field
Warning: Truncating oversized referrer field
Warning: Truncating oversized referrer field
Warning: Truncating oversized referrer field
Warning: Truncating oversized request field
Warning: Truncating oversized referrer field
Warning: Truncating oversized referrer field
Warning: Truncating oversized referrer field
Warning: Truncating oversized request field
Warning: Truncating oversized referrer field
Warning: Truncating oversized referrer field
Warning: Truncating oversized request field
Warning: Truncating oversized referrer field
Warning: Truncating oversized referrer field
Warning: Truncating oversized request field
Warning: Truncating oversized referrer field
Generating report for October 2005
Generating summary report
Saving history information...
17143 records (1 bad) in 1.21 seconds, 14167/sec
[root@sohigh /]#


/Joe

till
24th October 2005, 00:51
In the file my_webstatic.run you have to enter the full path to webalizer, e.g /usr/bin/webalizer and not only webalizer. When the script is run by cron, the Path variable is not set.

Joe-Montana
24th October 2005, 00:54
Thanks all work now