### ClamAV扫描病毒
~~~bash
yum install -y epel-release
yum install -y clamav
~~~
~~~bash
cat /etc/cron.d/clamav-update
~~~
## 每三个小时执行更新
~~~
0 */3 * * * root /usr/share/clamav/freshclam-sleep
~~~
## 更新病毒库
~~~
freshclam
~~~
## 病毒库文件
~~~
/var/lib/clamav/daily.cvd
/var/lib/clamav/main.cvd
~~~
## 扫描文件
~~~
clamscan targetfile
~~~
## 递归扫描home目录,并且记录日志
~~~
clamscan -r -i /home -l /var/log/clamscan.log
~~~
##递归扫描home目录,将病毒文件删除,并且记录日志
~~~
clamscan -r -i /home --remove -l /var/log/clamscan.log
~~~
##建议##扫描指定目录,然后将感染文件移动到指定目录,并记录日志
~~~
clamscan -r -i /home --move=/opt/infected -l /var/log/clamscan.log
~~~