LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-17-2015, 02:15 AM   #1
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 648

Rep: Reputation: 45
clamav not scan using script .


hi,
I have install ClamAV in my CentOS 6. I want that the anti virus should scan the system automatically . for that purpose

Code:
# service clamd start
then

Code:
vi /etc/cron.daily/daily_scan
Add the script in

Code:
SCAN_DIR="/"
LOG_FILE="/var/log/clamav/daily_scan.log"
/usr/bin/clamscan -i -r $SCAN_DIR >> $LOG_FILE
Made it executable
Code:
# chmod +x /etc/cron.daily/daily_scan
# ls -l
-rwxr-xr-x. 1 root root 113 Nov 17 12:10 daily_scan

I then add the file by

Code:
#  crontab -e 
45:8  * * * /etc/cron.daily/daily_scan
Just for own test I write it on terminal it show me

Code:
# /etc/cron.daily/daily_scan
/etc/cron.daily/daily_scan:line 4: var/log/clamav/daily_scan.log: No such file or directory
please guide me how can I fix it,I have review it many times but same message.please guide me.
 
Old 11-17-2015, 02:44 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
probably there is no directory /var/log/clamav
 
Old 11-17-2015, 03:23 AM   #3
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 648

Original Poster
Rep: Reputation: 45
Well there is already a directory.i.e clamav.
See the attachment herewith.
Attached Thumbnails
Click image for larger version

Name:	clamav.png
Views:	12
Size:	76.6 KB
ID:	20062  
 
Old 11-17-2015, 03:30 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
in your first post there is a missing slash:
/etc/cron.daily/daily_scan:line 4: /var/log/clamav/daily_scan.log: No such file or directory
Why?
 
Old 11-17-2015, 03:37 AM   #5
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 648

Original Poster
Rep: Reputation: 45
yes this a linux output command which it show me,there is no clash with var dir.
Attached Thumbnails
Click image for larger version

Name:	var.png
Views:	12
Size:	39.7 KB
ID:	20063  

Last edited by gardenair; 11-17-2015 at 03:48 AM.
 
Old 11-17-2015, 04:07 AM   #6
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
that means that / is missing and you need to fix that.
 
Old 11-18-2015, 04:24 AM   #7
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 648

Original Poster
Rep: Reputation: 45
Well I have fix the issue. One thing more i want to add that Is it possible in the script that if found a virus then e-mail at the address for example foo@gmail.com ?
 
Old 11-18-2015, 04:34 AM   #8
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
I do not really understand that question.
How did you fix it?
 
Old 11-18-2015, 04:52 AM   #9
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 648

Original Poster
Rep: Reputation: 45
Well my objective was to test the script ,the previous was not work on my vmware workrstaion,Well i did it on another non production server for my testing.The same things (script) works fine in it with out any problem.
Now I want to add more things in my script that is it possible that there should be a date stemp inside the summary?Following is the summary of my Clamav produced automatically by the system .


Code:
----------- SCAN SUMMARY -----------
Known viruses: 4106103
Engine version: 0.98.7
Scanned directories: 17968
Scanned files: 212007
Infected files: 0
Total errors: 3881
Data scanned: 9524.85 MB
Data read: 11547.87 MB (ratio 0.82:1)
Time: 4748.013 sec (79 m 8 s)
I need this type of summary.I just write Date and Time manually to show you.What more should I add in the script for the following output

Code:
----------- SCAN SUMMARY -----------
Date 19-11-2015
Time 13:00
Known viruses: 4106103
Engine version: 0.98.7
Scanned directories: 17968
Scanned files: 212007
Infected files: 0
Total errors: 3881
Data scanned: 9524.85 MB
Data read: 11547.87 MB (ratio 0.82:1)
Time: 4748.013 sec (79 m 8 s)

Last edited by gardenair; 11-19-2015 at 04:36 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Clamav - What does it scan? junior-s Linux - Software 1 02-11-2014 01:38 AM
file-scan-clamav-1.8 or clamav-0.93.1 invader44 Linux - Newbie 1 12-29-2009 08:49 AM
ClamAV scan with a LiveCD AvatarofVirgo Linux - Security 4 10-12-2007 05:08 PM
What is the best way to get clamav to scan emails? luca2005 Linux - Software 0 12-12-2004 04:52 AM
Clamav scan on demmand rooch84 Linux - Security 9 08-16-2004 09:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration