Hi ANthony

Thanks a bunch for your reply

>It would probably be best to put all the required commands into a script
>and just call the script using cron. Such a script might look like this:
>
>#!/bin/sh
>#
># Scan files for viruses and email a notice of the results.
>
># Who gets notified.
>[EMAIL PROTECTED]
>msgsubj='Antivirus Scan Results'
>
># Set the list of directories to scan
>dirlist='/www/servers/skylight.ubc.ca/media/ 
>/www/servers/skylight.ubc.ca/profsTalk'
>
># Send scan output to this file.
>reportfile=`date +%Y-%m-%d.txt`
>
># Run the scan and send the result notice.
>if sun sweep $dirlist > $reportfile; then
>   msgbody="Scan completed successfully. See $reportfile"
>else
>   msgbody="Scan failed. See $reportfile"
>fi
>echo "$msgbody" | mail -s "$msgsubj" $recipient
>
># End of script

This is so cool. I tried it out and it works great. Thanks so much. This 
solves my problem about the sending mail stuff to other ppl thatn the one 
specified in the mail to directive.

>
>In /etc/crontab, you can specify the user that the command should run as.
>Specifying root is no problem, if that is necessary for the command to
>function properly.

I'll look into this latter, but it seems to work when the .sh file is in the 
/root/scripts/ directory.

Great, thanks a lot for your assistance. You can do a lot of cool stuff with 
this os :)


Desmond Lee


_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com



-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to