Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 09-10-2004, 04:31 PM   #1
LQ Newbie
Registered: Sep 2003
Posts: 5

Rep: Reputation: 0
Scheduling scans for ClamAV and chkRootkit


Is there anyway to schedule regular full scans for both of these applications using cron? Could somebody explain this process very simply to me please...if thats possible!?

Also must these programs always be run as the root user? At the moment I am logging in as root and running them manually everytime, I'm looking for an automated solution if possible, where both programs have the required access without opening any holes unwittingly.

I have made efforts to find a simple explanation to no avail, I apologise if this has already been covered somewhere.

Many thanks,

Old 09-10-2004, 04:47 PM   #2
LQ Guru
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 379Reputation: 379Reputation: 379Reputation: 379
you can use cron to run programs periodically...

you can even have the results of the scans automatically emailed to you if you want...

basically, what you can do is:

- become root

- backup your current crontab:

cp /var/spool/cron/crontabs/root /root/crontab.backup

- create a new crontab with links to the scripts you wanna run, basing yourself on the original crontab, so as to keep those entries:

cp /root/crontab.backup /root/

vi /root/

- once you've finished editing the file, make it the current crontab:

crontab /root/

now the new crontab will be picked-up on the next cycle (every minute)...

if you mess-up, just restore the backup:

crontab /root/crontab.backup

make sure you read about how cron works and stuff before you do this...

good luck...

Last edited by win32sux; 09-10-2004 at 05:09 PM.
Old 09-10-2004, 04:53 PM   #3
LQ Guru
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
To do it with cron, type "crontab -e". Then edit or add a few lines.

<minute> <hour> <day of month> <month> <day of week> <command to run at schedule time or date>

minute = 0-59
hour = 0-23
day of month = 1-31
month = 1-12
day of week = 0-7 (0 or 7 is Sunday)

Put an * for each of unused five columns.

Type info "crontab(5)" for more information.

You can test the programs as a normal user but they probably display a lot of errors trying to read a file.
Old 09-11-2004, 09:24 AM   #4
LQ Newbie
Registered: Sep 2003
Posts: 5

Original Poster
Rep: Reputation: 0
Thanks for your help its working perfectly...I've been trying to get everything working for me since SuSE 5.2 fedora core 2 has come along and everything is going very well...for now !


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
virus scans mgrumiaux Linux - Security 8 02-11-2006 04:25 AM
unwanted port scans andy753421 Linux - Networking 1 09-28-2004 05:55 PM
Port scans!!! tarballedtux Linux - Security 4 10-29-2002 07:18 AM
Port scans KevStA Linux - Networking 2 05-27-2002 05:38 PM
Security scans LinuzRulz Linux - Security 6 01-15-2002 05:14 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:10 PM.

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