Abraham Panicker's Weblog
Abraham Panicker's Weblog
Archives
« November 2009
SunMonTueWedThuFriSat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
     
       
Today
Click me to subscribe
Search

Links
 

Today's Page Hits: 39

Locations of visitors to this page
« My struggle with... | Main | Studio Creator ..... »
Tuesday Nov 06, 2007
Shell script for nullifying Access Manager Log files

I thought of adding the following unix shell script I used  to reduce Log file sizes to zero for Access Manager.
The input to the script is '/var/opt/SUNWam', if it is a standard install.

 #!/bin/sh
clear
echo ""
indir=$1
echo "Input variable : "$1
echo ""
cd $indir/debug
for filename in *
do
 if [ -f $filename ] ; then
   cat /dev/null > $filename
   echo "File size "$filename "made 0";
  fi
done
cd $indir/debug/amadmincli
echo ""
echo "In amadmincli directory ..."
echo ""
for filename1 in *
do
 if [ -f $filename1 ] ; then
  cat /dev/null > $filename1
  echo "File size "$filename1 "made 0";
 fi
done
cd $indir/logs
echo ""
echo "In logs directory ..."
echo ""
for filename2 in *
do
 if [ -f $filename2 ] ; then
  cat /dev/null > $filename2
  echo "File size "$filename2 "made 0";
 fi
done
cd /opt/utils

Posted at 02:03PM Nov 06, 2007 by apanicker in Technical  | 

Comments:

Post a Comment:
Comments are closed for this entry.