Clamav

less than 1 minute read

Install


yum -y install clamav clamd
service clamd start
chkconfig clamd on

Freshclam cron job (Under /etc/cron.daily)

#!/bin/sh
### A simple update script for the clamav virus database.
### This could as well be replaced by a SysV script.
### fix log file if needed
LOG_FILE="/var/log/clamav/freshclam.log"
if [ ! -f "$LOG_FILE" ]; then
    touch "$LOG_FILE"
    chmod 644 "$LOG_FILE"
    chown clam.clam "$LOG_FILE"
fi
/usr/bin/freshclam \
    --quiet \
    --datadir="/var/lib/clamav" \
    --log="$LOG_FILE"

clamscan.cron (under /etc/cron.daily)


#!/bin/bash
SCAN_DIR="/export/home"
LOG_FILE="/var/log/clamav/nightly_clamscan.log"
if [ ! -f "$LOG_FILE" ]; then
    touch "$LOG_FILE"
    chmod 644 "$LOG_FILE"
    chown clam.clam "$LOG_FILE"
fi
/usr/bin/clamscan -i -r "$SCAN_DIR >> $LOG_FILE"

Updated: