[clamav-users] connect clamscan output to journal with systemd-cat
SCOTT PACKARD
Scott.Packard at raytheon.com
Wed Apr 3 12:58:06 UTC 2019
Logfiles are a place where a sysadmin notices a host running smoothly (lack of anything in logs) or has problems (error messages about the programs show up in the logs).
Looks like you are trying to misuse logfiles as a place to put successful/unsuccessful output that's produced by a program.
You'll want to create a separate log for your program, foo.log, and write it to /var/log/ directory.
Others can comment about scanning a host every minute.
Regards, Scott
From: clamav-users <clamav-users-bounces at lists.clamav.net> On Behalf Of Kretschmer, Jens
Sent: Wednesday, April 03, 2019 1:34 AM
To: clamav-users at lists.clamav.net
Subject: [External] [clamav-users] connect clamscan output to journal with systemd-cat
Hi,
I would like to redirect the output of clamscan to the journal, which should by possible by
/usr/bin/clamscan -r /root/ 2>&1 | /usr/bin/systemd-cat --identifier="clamscan"
or
/usr/bin/systemd-cat --identifier="clamscan" /usr/bin/clamscan -r /root/
While both commands work when executed manually in the terminal, the output is not redirected when executed by a cronjob. If I put the following line into the file /etc/cron.d/clamav
* * * * * root /usr/bin/systemd-cat --identifier="clamscan" /usr/bin/clamscan -r /root/
I can see that the clamscan process is started every minute, but the output is not redirected to the journal.
If I put the line
* * * * * root /usr/bin/systemd-cat --identifier="clamscan" ls /root/
Into the file /etc/cron.d/clamav, it is executed every minute as well and I can see the output of ls in the journal.
Do you have any idea what could be causing the issue?
Best regards,
Jens
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clamav.net/pipermail/clamav-users/attachments/20190403/ff480bc5/attachment.htm>
More information about the clamav-users
mailing list