Hello,
I have created the following script. My purpose of this script is to "cat info from /var/log/messages then filter for the following keywords: ssh* and the current date. Once I gather this info I would then mail it to myself.
The problem I am running into...there is no data being cat'ed out. Hmm...Could someone look this over then let me know what I need to change?
Thanks in advance for your help!
-Xaviar
P.S.
I am running this script as root! :-)
# -- Bellow is the script --
#! /bin/bash
#-------------------------------------------------------------
# This scripts sends fail sshd attempts to root's mail account
#-------------------------------------------------------------
# Variables
#
DATE=`date +'%b %e'`
# Searching for the ssh info filtered by date and ssh*
#
cat /var/log/messages |grep ssh* |grep %DATE | mail -s "SSH Log-Failed Attempts"
myemail@something.com