Code Files

gw-userdb-size.awk

Generated on Tue Dec 05 17:39:06 Eastern Standard Time 2006 from gw-userdb-size.awk


# Program	: gw-userdb-size.awk
# Purpose	: Parse through DIR of message databases, flag large files
# Date		: 15 February 2005
# Author	: Bob Jonkman

# Variable	: THRESHOLD defined on command line

BEGIN			{ 	IGNORECASE = 1 ; # some directory results are in lower case
				QUOTE = "\"" ;
				Mebi = 1024 * 1024 ;
				print("Size,UserDB,Agent,Size in MiBytes,Server") ;
				vcount = 0 ;
				
			}

/Agent=/		{	agent = $2 ;
			}

/Volume in drive/   {   link = $4 ;
			        }

/[.]DB/		{	# print("##### DEBUG #####" agent,$0) ;
                size  = $3 / Mebi ;
                userdb = $4 ;
                count++ ;

                # print("##### DEBUG #####" agent,$0) ;

                printf("%18i,%s,%s,%.1f,%s\n", $3 , userdb, agent, size, link ) | "sort /R" ;

                if(size > THRESHOLD)
                {    vcount++ ;
                    vtext[vcount,"p"] = agent ;
                    vtext[vcount,"m"] = userdb ;
                    vtext[vcount,"s"] = size ;
                }

            }

END            { print("=====") ;
                 print("Files,"      , count     , ",,," );
                 print("Threshold,,,", THRESHOLD , ","   );
                 print("Violations," , vcount    , ",,," );


}

# EOF: gw-userdb-size.awk     
   

1 files processed.