I like to get todays entries from log file so that I can send that to my email every day. This is my command, its not working please help.
cat /var/log/fail2ban.log | grep "date +%Y\-%m\-%d"
I like to get todays entries from log file so that I can send that to my email every day. This is my command, its not working please help.
cat /var/log/fail2ban.log | grep "date +%Y\-%m\-%d"
I will put my comment as an answer.
You want this:
cat /var/log/fail2ban.log | grep `date +%Y-%m-%d`
The text between the two backticks ` is executed by your shell, and is replaced by the output of the command.