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 »

  1. This is certainly a superb write-up. Thanks a ton for taking the time to describe this all out for all of us. It’s a great guide!

    Comment by Bill Discipio | June 15, 2011 | Reply

  2. I can tell the understanding of this subject matter is deep and comprehensive. What a treat to discover somebody blogging whom not merely boasts information but in addition the ability to connect via easy to imagine and recall info-bytes. Blog a lot more!

    Comment by filtered water | June 16, 2011 | Reply


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: