Quote:
Originally Posted by Thaidog
I need to run the following command as a cron job that will email me every day:
for ip in `awk '/Invalid user/ {print $10}' /var/log/secure |sort -u`; do echo "$ip : "`grep -c $ip /var/log/secure`; done
Can somebody tell me a simple way to add that to a shell script?
|
Code:
for ip in `awk '/Invalid user/ {print $10}' /var/log/secure |sort -u`; do echo "$ip : "`grep -c $ip /var/log/secure` | mail user@host -s 'subject here'; done
This assumes that you have outbound email set up on your machine.