MLM logcheck script

From cpwiki.net
Revision as of 22:13, 27 March 2013 by Nighthawk (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Check Point Profressional Services

This is a simple logcheck script to identify logs older that 20 days. The output can be piped to a script for compression.

#!/bin/sh
#
source $CPDIR/tmp/.CPprofile.sh
RETENTION=20
CPSUITE_DIR=`echo $MDS_TEMPLATE | awk -F "/" '{print $3}'`
#
mdsenv
mcd customers
for CLM in *
do
  find $CLM/$CPSUITE_DIR/fw1/log/*.log -mtime +$RETENTION | grep -v fwui.log 
done