[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-users] [OFF TOPIC] script to do cat /var/log/maillog | grep DENIED



> > At the moment i type,
> > cat /var/log/maillog | grep DENIED
> > 
> > to see if there have been any mails denied today.
> > 
> > Can someone make me a script that will do this for me at regular 
> > intervals? (and maybee send the results to email or html).
> 
could use 2 liner

#!/bin/sh
cat /var/log/maillog | grep DENIED | mail you@xxxxxxxxxxxxxx


## above to email you or could just write to a file which u would need to clean out every so often - maybe another cron say weekly to remove it?

#!/bin/sh
cat /var/log/maillog | grep DENIED >> /home/sites/sitexx/web/deniedstuff

pop into one of the cron directories and chmod 755 have to be root
ie
/etc/cron.hourly
/etc/cron.daily

b w g






> 
> _______________________________________________
> cobalt-users mailing list
> cobalt-users@xxxxxxxxxxxxxxx
> To Subscribe or Unsubscribe, please go to:
> http://list.cobalt.com/mailman/listinfo/cobalt-users
> 
> 


---------------------------------------------------
http://www.coolcat.net      http://www.coolcoach.net 
  8:01am  up 9 days, 15:20,
If Bill Gates had a nickel for every time Windows crashed... Oh wait, he does.