script runs fine, just not as a cron job

Permabanned
Joined
17 Oct 2002
Posts
172
Location
/dev/null
i'm written a very simple bash script to run webalizer on my web logs, and it works fine. when i set up a cron job to run it every half hour however, it says the command cannot be found :confused:

just running it:
Code:
[root@Gemini root]# sh /home/stat-www.pl
Webalizer V2.01-10 (Linux 2.4.18-3smp) English
Using logfile /home/www/logs/access.log (clf)
Creating output in current directory
Hostname for reports is 'Gemini.ihateaol.co.uk'
Reading history file... webalizer.hist
Generating report for October 2002
Generating report for November 2002
Generating summary report
Saving history information...
11704 records in 0.71 seconds
[root@Gemini root]#

but i get this email when it is run as a cron job:
Code:
From
[email][email protected][/email] (Cron Daemon)
To
[email][email protected][/email]
Date
Thu, 14 Nov 2002 20:00:01 GMT
Subject
Cron <root@Gemini> sh /home/stat-www.pl

/home/stat-www.pl: webalizer: command not found

any ideas?
 
all it is is:

#!/bin/bash

cd /home/www/html/misc/stat
webalizer /home/www/logs/access.log

has to change to the stat directory first cos thats where it generates the files when webalizer is run
 
i perfer find / -name webalizer ;)

also, running the cron job manually worked, and nothing had any trouble finding webalizer any other time. we'll see if this works in 25 mins anyway
 
sweet :D

now for the super simple problem... the server clock is wrong, how can i set it and keep it synchronised?

i added "server <time server IP>" to /etc/ntp.conf but i dunno what to do from there. RH 7.3
 
Originally posted by fIREfox
How did you install it into cron? Pop the script into /etc/cron.hourly or into crontab -e?

Im guessing its the first in which case it probs a cron config setting.... a quick look round /etc and I cant see anything obvious tho..

crontab -e, cos i want it every 30 mins. fix0red now anyway thx :)
 
[root@Gemini etc]# /usr/sbin/ntpdate ntp.demon.nl
15 Nov 00:01:46 ntpdate[15656]: step time server 194.159.73.44 offset 3400.608745 sec

haha :D you guys rock
thanks a lot
 
Back
Top Bottom