LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


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

Rep: Reputation: 0
Scheduling scans for ClamAV and chkRootkit


Hi,

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
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

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

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

http://www.google.com/linux?hl=en&lr...=Google+Search


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/crontab.new

vi /root/crontab.new


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

crontab /root/crontab.new

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
Electro
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
BoxUnclever
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 ....now fedora core 2 has come along and everything is going very well...for now !
 
  


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 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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:52 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