Cron Job For Email
The subject line of the daily email is "egrep "POST .*wp-login.php" ~/access-logs/chaindriven.net | awk '{print $1,$4,$5,$6,$7,substr($0, index($0,$12))}' | awk '{print $1}' | sort -n | uniq -c | sort -n | sed 's/[ ]*//'"
and I am pretty sure my mistake is that I put the site path in incorrectly. Can you orient me please?
Thanks,
egrep "POST .*admin-ajax.php" ~/access-logs/example.com | awk '{print $1,$4,$5,$6,$7,substr($0, index($0,$12))}' | awk '{print $1}' | sort -n | uniq -c | sort -n | sed 's/[ ]*//' | mail -s "Report" [email protected]
Of course, be sure to replace [email protected] with the email address that you want it sent to. One other addition that I recommend in this script would be to use grep -v to filter our your own IP address. This can be accomplished like this:egrep "POST .*admin-ajax.php" ~/access-logs/example.com | grep -v 123.123.123.123 | awk '{print $1,$4,$5,$6,$7,substr($0, index($0,$12))}' | awk '{print $1}' | sort -n | uniq -c | sort -n | sed 's/[ ]*//' | mail -s "Report" [email protected]