diff -ruN smeserver-audittools-1.4.0.old/root/sbin/e-smith/audittools/logcheck smeserver-audittools-1.4.0/root/sbin/e-smith/audittools/logcheck --- smeserver-audittools-1.4.0.old/root/sbin/e-smith/audittools/logcheck 1969-12-31 16:00:00.000000000 -0800 +++ smeserver-audittools-1.4.0/root/sbin/e-smith/audittools/logcheck 2014-02-02 13:32:30.000000000 -0800 @@ -0,0 +1,25 @@ +#!/bin/bash +#logcheck [days] [location] +re='^[0-9]+$' +days=2 +location=/tmp + +# If there is a second arg, use it as the location +if ! [ -z "$2" ]; then + location=$2 +fi + +# If first arg is a number, then set days. +if ! [ -z "$1" ]; then + if [[ $1 =~ $re ]] ; then + days=$1 + else + location=$1 + fi; +fi + +echo "Log file: $location/log$(date +'%m%d%y')" +find /var/log/ -mtime -$days -print -exec sh -c 'cat "{}" | tai64nlocal | egrep -i "useless|warn|fail|error|disable|remov|unable|exit"' \; > "$location/log$(date +'%m%d%y')" 2>&1 + +exit 0 +