0

I am running this cron job

30 01 * * * /usr/bin/freshclam --quiet; /usr/bin/clamscan --recursive --no-summary --infected / 2>/dev/null

but i am receiving a daily email with error:

ERROR: Problem with internal logger (UpdateLogFile = /var/log/clamav/freshclam.log).
ERROR: /var/log/clamav/freshclam.log is locked by another process

I can't see what the problem is.

JoaMika
  • 499
  • 2
  • 9
  • 21

1 Answers1

0
lsof | grep freshclam.log

will give you the details on which program/process is using this file.

  • I am only getting one process: freshclam 1506 clamav 3wW REG 253,1 50034 1055269 /var/log/clamav/freshclam.log – JoaMika Sep 14 '16 at 18:27
  • Do you also get the error, when the job is not executed by cron, but when you do it manually? – Stefan Guenther Sep 14 '16 at 20:42
  • Maybe you could use the following command to debug the problem: `/usr/bin/freshclam --verbose --debug > /tmp/freshlcam.log 2>&1` or send the output to a different logfile: `/usr/bin/freshclam --quiet --log=/var/log/clamav/freshclam-cron.log` – Stefan Guenther Sep 15 '16 at 06:00
  • Today i also got an out of memory notification at the time the cron job started at var/log/syslog: Out of memory: Kill process 1419 (clamd) score 400 or sacrifice child – JoaMika Sep 15 '16 at 09:32
  • I guess the question becomes: do i really need to run this cronjob? Isn't clamav always running on the background and actively detecting threads? It's taking too much memory as it is... – JoaMika Sep 15 '16 at 10:28
  • To be honest, the question might also be: Is clamav good enough to use it? Does it reliably detect current threads? I doubt it and that's the reason why we have been using commercial solutions for our clients for years now. – Stefan Guenther Sep 16 '16 at 13:48
  • hi stefan, could you please recommend a better alternative? – JoaMika Sep 16 '16 at 17:16
  • I don't use the server to receive any emails. Only outgoing emails through postfix which goes through google apps antivirus anyway. Server is Ubuntu 16 – JoaMika Sep 16 '16 at 17:33
  • Well, we are either using Kaspersky or ESET, depends on what the customer wants to use on the desktop. We then take the other product for the server. – Stefan Guenther Sep 17 '16 at 18:44