|
Missing "&" in the cron ?
|
| Author |
Message |
FeG
Junior Member

Posts: 167
Joined: Aug 2007
Reputation: 2
|
Missing "&" in the cron ?
Hi..
I've got a question related to this ticket (created by BeNe):
After upgrading from RC2c to RC3 (and activating AWStats thereby), I get mails like this every 30min:
Quote:Subject: Cron <root@hostname> /var/www/ispcp/engine/traffic/ispcp-vrl-traff >/var/log/ispcp/ispcp-vrl-traff.log
/usr/bin/diff: /var/log/ispcp/domain.de-traf.log: No such file or directory
/usr/bin/diff: /var/log/ispcp/domain.de-traf.log: No such file or directory
/bin/mv: cannot stat `/var/log/ispcp/domain.de-traf.log': No such file or directory
sys_command() | ERROR: External command '/bin/mv /var/log/ispcp/domain.de-traf.log /var/log/ispcp/domain.de-traf.log.prev' returned '1' status !
sys_command() | Starting...
diff_command() | Ending...
diff_command() | Starting...
diff_command() | ERORR: '/usr/bin/diff -a -q /var/log/ispcp/domain.de-traf.log /var/log/ispcp/domain.de-traf.log.prev' returned '2' !
diff_command() | Starting...
sys_command('/bin/cp /var/log/apache2/domain.de-traf.log /var/log/ispcp/domain.de-traf.log') | Ending...
sys_command() | Starting...
gen_log_file() | Starting...
collect_http_traffic() | Starting...
vrl_traff_engine() | Starting...
vrl_traff_start_up() | Ending...
zero_traffic_entries() | Ending...
zero_traffic_entries() | Starting...
doSQL() | Ending...
doSQL() | Starting...
doSQL() | Ending...
doSQL() | Starting...
doSQL() | Ending...
doSQL() | Starting...
get_conf() | Ending...
setup_main_vars() | Ending...
decrypt_db_password() | Ending...
decrypt_db_password() | Starting...
setup_main_vars() | Starting...
get_file() | Ending...
get_file() | Starting...
get_conf() | Starting...
vrl_traff_start_up() | Starting...
get_conf() | Ending...
setup_main_vars() | Ending...
decrypt_db_password() | Ending...
decrypt_db_password() | Starting...
setup_main_vars() | Starting...
get_file() | Ending...
get_file() | Starting...
get_conf() | Starting...
The domain mentioned there isn't always the same, there are even sometimes different domains occuring in one mail. Furthermore I don't get such a mail every 30min, but mostly.
My question is: Is this behaviour normal and there is - as stated by BeNe in the ticket - only a "&" missing to suppress the errors or is something wrong with my logfiles?
Thanks in advance,
FeG
|
|
| 02-15-2008 09:44 PM |
|
FeG
Junior Member

Posts: 167
Joined: Aug 2007
Reputation: 2
|
RE: Missing "&" in the cron ?
joximu Wrote:Normally you put a & after a command to get back to the shell and letting the command run "in behind"...
That's korrekt, if it's only a &, but &> means something else: It redirects stdout and stderr (output and error-output) to the given file. (see http://www.faqs.org/docs/Linux-HOWTO/Bas...tml#ss3.6)
Therefore, maybe it is missing at this point.
Quote:You should look at the log files mentioned in the message...
The error is No such file or directory - so it'll be difficult to look at the log files
Greetings
FeG
|
|
| 02-15-2008 10:12 PM |
|
FeG
Junior Member

Posts: 167
Joined: Aug 2007
Reputation: 2
|
RE: Missing "&" in the cron ?
joximu Wrote:But it should not cause any problems - the only thing:
errorr are mailed instead of logged...
Sure it doesn't cause problems, but my question was if these errors I quoted above are normal behaviour.
I guess they aren't, because otherwise there'd be some posts about this problem here...
So does anyone knows what causes this problem?
Greetings
FeG
|
|
| 02-15-2008 10:48 PM |
|
FeG
Junior Member

Posts: 167
Joined: Aug 2007
Reputation: 2
|
RE: Missing "&" in the cron ?
Does anybody can verify that this is normal behaviour so there's nothing wrong with adding "&>" to this line?
|
|
| 02-18-2008 06:33 PM |
|
FeG
Junior Member

Posts: 167
Joined: Aug 2007
Reputation: 2
|
RE: Missing "&" in the cron ?
I've just detected another problem connected with this:
The daily cronjob causes an error, sent to me by mail:
Quote:error: error running prerotate script for /var/log/proftpd/ftp_traff.log, leaving old log in place
run-parts: /etc/cron.daily/logrotate exited with return code 1
The log-rotation for ftp_traff.log is defined as follows:
Code:
/var/log/proftpd/ftp_traff.log {
daily
rotate 7
missingok
compress
delaycompress
prerotate
/var/www/ispcp/engine/traffic/ispcp-vrl-traff > /var/log/ispcp/ispcp-vrl-traff.log
endscript
postrotate
/usr/bin/killall -HUP syslogd
endscript
}
So here is ispcp-vrl-traff also called without an & ..
Again my question: Is it normal that this script causes errors (i.e. if, as joximu said, a domain hadn't caused any traffic this day) or is there a problem with my logfiles?
Greetings
FeG
|
|
| 02-18-2008 06:51 PM |
|
FeG
Junior Member

Posts: 167
Joined: Aug 2007
Reputation: 2
|
RE: Missing "&" in the cron ?
Can anyone check this with his installation? I'm sure I'm not the only one having domains on my system that perhaps doesn't cause traffic one day.
|
|
| 02-20-2008 10:37 PM |
|