UnixServerAdmin

Server Administration & Management

clamav_scan.sh

###########################################################
## clamav_scan.sh ##
###########################################################
## Make a Directory /REPORTS ##
## Make a file msg.txt under /REPORTS Directory ##
## Write Following in msg.txt file ##
###########################################################
## Hi, ##
## The ClamAV Scan process of “/home” partition of the server has been completed. ##
## For ClamAV Scan Report, please check the attached clamav Report. ##
## Thanks & Regards, ##
## Unixserveradmin.com Security Team ##
###########################################################
#! /bin/bash

/bin/echo “==========================================================” > /REPORTS/clamav.log_$(date +%d%m%y)
/bin/echo “THE ClamAV Scan is started at $(date)” >> /REPORTS/clamav.log_$(date +%d%m%y)
/bin/echo “==========================================================” >> /REPORTS/clamav.log_$(date +%d%m%y)

/bin/echo ”      ” >> /REPORTS/clamav.log_$(date +%d%m%y)
/bin/echo ”      ” >> /REPORTS/clamav.log_$(date +%d%m%y)
/bin/echo “========================================================” >> /REPORTS/clamav.log_$(date +%d%m%y)
/bin/echo “ClamAV Update Logs:”  >> /REPORTS/clamav.log_$(date +%d%m%y)
/bin/echo “——————————————————–”  >> /REPORTS/clamav.log_$(date +%d%m%y)
/usr/bin/freshclam >> /REPORTS/clamav.log_$(date +%d%m%y)
/bin/echo “——————————————————–” >> /REPORTS/clamav.log_$(date +%d%m%y)

/bin/echo ”      ” >> /REPORTS/clamav.log_$(date +%d%m%y)
/bin/echo ”      ” >> /REPORTS/clamav.log_$(date +%d%m%y)
/bin/echo “========================================================” >> /REPORTS/clamav.log_$(date +%d%m%y)
/bin/echo “ClamAV Logs are as follows:”  >> /REPORTS/clamav.log_$(date +%d%m%y)
/bin/echo “——————————————————–”  >> /REPORTS/clamav.log_$(date +%d%m%y)
/usr/bin/clamdscan –remove /home/ >> /REPORTS/clamav.log_$(date +%d%m%y)
/bin/echo “——————————————————–” >> /REPORTS/clamav.log_$(date +%d%m%y)
/bin/echo “——————————————————–” >> /REPORTS/clamav.log_$(date +%d%m%y)

/bin/echo “==================================================================” >> /REPORTS/clamav.log_$(date +%d%m%y)
/bin/echo “THE ClamAV Scan has been completed at $(date)” >> /REPORTS/clamav.log_$(date +%d%m%y)
/bin/echo “==================================================================” >> /REPORTS/clamav.log_$(date +%d%m%y)

mutt -s “ClamAV Scan REPORT $(hostname | tr ‘a-z’ ‘A-Z’)” -a /REPORTS/clamav.log_$(date +%d%m%y) unixserv@unixserveradmin.com < /REPORTS/msg.txt

mutt -s “ClamAV Scan REPORT $(hostname | tr ‘a-z’ ‘A-Z’)” -a /REPORTS/clamav.log_$(date +%d%m%y) info@unixserveradmin.com < /REPORTS/msg.txt

May 6, 2011 Posted by | Security, Shell Script | , , | 2 Comments