Solved

Points for Techno__Mage

Posted on 2002-07-20
2
210 Views
Last Modified: 2010-04-20
Thanks for your help.

Sebastian
0
Comment
Question by:sderaadt
2 Comments
 
LVL 1

Accepted Solution

by:
Techno__Mage earned 50 total points
ID: 7171024
Thank you for being cool enough to split 'em up.  
Also, if you use f-prot and schedule a system scan during a time the box might be used for other things...  you might want to add "nice " in front of the command that runs it.  
Here's the script I have cron run nightly, if you're interested.  (Sorry, not as well commented as I usually do)...  

#!/bin/bash


# If more than one net interface is "UP", then try to check-updates

if [ `/sbin/ifconfig | grep UP | wc -l` -ge 2 ]; then
        nice /usr/local/f-prot/check-updates.sh -cron
fi


# Run f-prot scanner on entire filesystem

REPORTNAME="/var/log/f-prot/f-prot.day-`date +%d`.log"
EMAIL_ADDR="root user@outside.domain"
EMAIL_SUBJ="F-Prot AntiVirus Report"
OSNAME=`uname -s`

nice /usr/local/bin/f-prot -report=$REPORTNAME -silent -ai -archive -ext -packed /

# Unless f-prot exit code is "0", email report
case "$?" in
        0)
                ;;
        *)
                case "$OSNAME" in
                        Linux)
                                # For mail versions that refuse to read subject header from file input
                                mail -s "$EMAIL_SUBJ" $EMAIL_ADDR < "$REPORTNAME"
                                ;;
                        *)
                                # For mail versions that happily interpret headers from file input
                                echo $EMAIL_SUBJ > "$REPORTNAME".msg
                                echo >> "$REPORTNAME".msg
                                cat $REPORTNAME >> "$REPORTNAME".msg
                                mail $EMAIL_ADDR < $REPORTNAME.msg
                                rm -f "$REPORTNAME".msg > /dev/null
                                ;;
                esac
                ;;
esac

0
 

Author Comment

by:sderaadt
ID: 7171236
Thanks Techno Mage, that script looks good. Unfortunately I havn't had time to look at f-prot yet - but maybe in the next few weeks.

Thanks again

Sebastian
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Currently, there is not an RPM package available under the RHEL/Fedora/CentOS distributions that gives you a quick and easy way to allow PHP to interface with Oracle. As a result, I have included a set of instructions on how to do this with minimal …
rdate is a Linux command and the network time protocol for immediate date and time setup from another machine. The clocks are synchronized by entering rdate with the -s switch (command without switch just checks the time but does not set anything). …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now