i have a .sh script that contains the following:
#!/usr/bin/sh
/bin/echo IP: > /home/user/public_html/fail2ban.txt
/bin/zgrep -h "Ban " /var/log/fail2ban.log* | awk '{print $NF}' | sort | logres$
/bin/echo SUBNETS: >> /home/user/public_html/fail2ban.txt
/bin/zgrep -h "Ban " /var/log/fail2ban.log* | awk '{print $NF}' | awk -F\. '{pr$
/bin/echo SERVICES: >> /home/user/public_html/fail2ban.txt
/bin/grep "Ban " /var/log/fail2ban.log | awk -F[\ \:] '{print $10,$8}' | sort |$
/bin/echo TODAY: >> /home/user/public_html/fail2ban.txt
/bin/grep "Ban " /var/log/fail2ban.log | grep `date +%Y-%m-%d` | awk '{print $NF}' | sort | awk '{print $1,"("$1")"}' | logresolve | uniq -c | sort >> /home/user/public_html/fai$
(just some fail2ban.log filtering and dysplay)
then have on contrab this
*/1 * * * * /root/fail2ban.sh >/dev/null 2>&1
the script doesnt work with contrab, if i run it manually it works.. can someone give some help pls?
ty in advance