Help - Search - Members - Calendar
Full Version: Debian5 crontab running .sh help
Linuxhelp > Support > Technical Support
ekun
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
michaelk
You might want to include the full path for uniq and sort.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2017 Invision Power Services, Inc.