Current time: 12-24-2024, 01:09 PM Hello There, Guest! (LoginRegister)


Post Reply 
Missing "&" in the cron ?
Author Message
FeG Offline
Banned

Posts: 222
Joined: Aug 2007
Post: #1
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
Find all posts by this user Quote this message in a reply
joximu Offline
helper
*****
Moderators

Posts: 7,024
Joined: Jan 2007
Reputation: 92
Post: #2
RE: Missing "&" in the cron ?
Normally you put a & after a command to get back to the shell and letting the command run "in behind"...
I wrote something in the ticket - I think the & are not needed.

You should look at the log files mentioned in the message...
(This post was last modified: 02-15-2008 09:53 PM by joximu.)
02-15-2008 09:53 PM
Visit this user's website Find all posts by this user Quote this message in a reply
FeG Offline
Banned

Posts: 222
Joined: Aug 2007
Post: #3
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 Wink

Greetings
FeG
02-15-2008 10:12 PM
Find all posts by this user Quote this message in a reply
joximu Offline
helper
*****
Moderators

Posts: 7,024
Joined: Jan 2007
Reputation: 92
Post: #4
RE: Missing "&" in the cron ?
ok, just learned something :-)

so it's more or less an abbr. for

command > ... 2> ....
or
command 1> ... 2> ....

thanx - I never used this syntax.

But it should not cause any problems - the only thing:
errorr are mailed instead of logged...

/J
02-15-2008 10:19 PM
Visit this user's website Find all posts by this user Quote this message in a reply
FeG Offline
Banned

Posts: 222
Joined: Aug 2007
Post: #5
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
Find all posts by this user Quote this message in a reply
joximu Offline
helper
*****
Moderators

Posts: 7,024
Joined: Jan 2007
Reputation: 92
Post: #6
RE: Missing "&" in the cron ?
Maybe there is not traffic at all for some domains - then there may be no log file (just an idea).
If you add the & just before the > then you won't see theese messages.

of course: the diff command should not be executed if the mv was not ok... Smile
02-15-2008 11:37 PM
Visit this user's website Find all posts by this user Quote this message in a reply
FeG Offline
Banned

Posts: 222
Joined: Aug 2007
Post: #7
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
Find all posts by this user Quote this message in a reply
FeG Offline
Banned

Posts: 222
Joined: Aug 2007
Post: #8
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
Find all posts by this user Quote this message in a reply
FeG Offline
Banned

Posts: 222
Joined: Aug 2007
Post: #9
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
Find all posts by this user Quote this message in a reply
Cube Offline
Member
***

Posts: 740
Joined: Apr 2007
Reputation: 9
Post: #10
RE: Missing "&" in the cron ?
I have such domains, but I don't get this error.
02-20-2008 11:49 PM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 3 Guest(s)