Ned to send command output to email
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? |
Quote:
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 |
Quote:
|
All times are GMT -5. The time now is 07:40 PM. |