ClamAV is an open source (GPL) antivirus engine designed for detecting Trojans, viruses, malware and other malicious threats on Linux. In this article, we will only be configuring ClamAV to run scheduled/on-demand scans; not resident scans.
A. Install ClamAV
1. Install EPEL repo
Before we can do proceed, you must ensure that you have the EPEL yum repository enabled. To do this, click here.
2. Install required ClamAV packages
โค้ด: เลือกทั้งหมด
yum install clamav clamdโค้ด: เลือกทั้งหมด
/etc/init.d/clamd oโค้ด: เลือกทั้งหมด
chkconfig clamd onโค้ด: เลือกทั้งหมด
/etc/init.d/clamd startโค้ด: เลือกทั้งหมด
/usr/bin/freshclamB. Configure Daily Scan
In this example, we will configure a cronjob to scan the /home/ directory every day:
1. Create cron file:
โค้ด: เลือกทั้งหมด
vi /etc/cron.daily/manual_clamscanโค้ด: เลือกทั้งหมด
#!/bin/bash
SCAN_DIR="/home"
LOG_FILE="/var/log/clamav/manual_clamscan.log"
/usr/bin/clamscan -i -r $SCAN_DIR >> $LOG_FILEโค้ด: เลือกทั้งหมด
chmod +x /etc/cron.daily/manual_clamscanAnd you’re done! That should be the minimum required to 1. install ClamAV and 2. Perform a daily scan of a specific directory.
https://www.centosblog.com/how-to-insta ... on-centos/