Categories
How-To Software

My ClamAV Installation and Configuration on Ubuntu Server

To install ClamAV run the following command

apt-get update
apt-get install clamav

Manually update virus databases

freshclam

You will see ClamAV update process started
To manually scan files/folders for viruses

clamscan -r /location_of_files_or_folders

Sample Output

———– SCAN SUMMARY ———–
Known viruses: 1184347
Engine version: 0.97.3
Scanned directories: 60
Scanned files: 334
Infected files: 0
Data scanned: 309.25 MB
Data read: 3539.62 MB (ratio 0.09:1)
Time: 124.897 sec (2 m 4 s)

Automatically scan files/folders for viruses

e.g. Automatically scan files/folders for viruses at midnight everyday
* * * * * means minute hour date month year
you need to edit your crontab file

crontab -e

Append the following line at the end of file
00 00 * * * clamscan -r /location_of_files_or_folder