Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )



Advanced DNS Management
New ZoneEdit. New Managment.

FREE DNS Is Back

Sign Up Now
 
Reply to this topicStart new topic
> Debian5 crontab running .sh help, Debian5 crontab running .sh help
ekun
post Jan 21 2011, 11:06 AM
Post #1


Whats this Lie-nix Thing?
*

Group: Members
Posts: 1
Joined: 21-January 11
Member No.: 14,997



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
Go to the top of the page
 
+Quote Post
michaelk
post Jan 23 2011, 05:42 PM
Post #2


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,797
Joined: 23-January 03
Member No.: 360



You might want to include the full path for uniq and sort.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 23rd October 2017 - 09:14 PM