Hi,
I've (finally) started using qmailanalog, but when i try to pass a specific maillog
through matchup i get the following error :
matchup: fatal: unable to write to fd 5: file descriptor not open
I'm using a script to pass maillog & maillog.1 thu 7 to matchup.
2 of the logs generate this error :-(
I've attached the script, just in case.
I know it's not great programming, it's more 'brute force', but i'm a newbie to unix
and haven't gotten the hang of scripting yet :-(
Thanks,
Steffan
--
http://therookie.dyndns.org
#####
## Which shell to use for processing
#####
#!/usr/local/bin/bash
#####
## Where should temporary files be stored
#####
TempLoc=/tmp
#####
## Where can i find the log files
#####
LogLoc=/var/log
cd $TempLoc
echo preprocessing maillog.7
echo -n ' copying'
cp $LogLoc/maillog.7.gz .
echo ' .'
echo -n ' unpacking'
gunzip ./maillog.7.gz
echo ' .'
echo -n ' filtering'
awk '{$1="";$2="";$3="";$4="";$5="";print}' ./maillog.7 | matchup
>./matchup.out
echo ' .'
echo preprocessing maillog.6
echo -n ' copying'
cp $LogLoc/maillog.6.gz .
echo ' .'
echo -n ' unpacking'
gunzip ./maillog.6.gz
echo ' .'
echo -n ' filtering'
awk '{$1="";$2="";$3="";$4="";$5="";print}' ./maillog.6 | matchup
>>./matchup.out
echo ' .'
echo preprocessing maillog.5
echo -n ' copying'
cp $LogLoc/maillog.5.gz .
echo ' .'
echo -n ' unpacking'
gunzip ./maillog.5.gz
echo ' .'
echo -n ' filtering'
awk '{$1="";$2="";$3="";$4="";$5="";print}' ./maillog.5 | matchup
>>./matchup.out
echo ' .'
echo preprocessing maillog.4
echo -n ' copying'
cp $LogLoc/maillog.4.gz .
echo ' .'
echo -n ' unpacking'
gunzip ./maillog.4.gz
echo ' .'
echo -n ' filtering'
awk '{$1="";$2="";$3="";$4="";$5="";print}' ./maillog.4 | matchup
>>./matchup.out
echo ' .'
echo preprocessing maillog.3
echo -n ' copying'
cp $LogLoc/maillog.3.gz .
echo ' .'
echo -n ' unpacking'
gunzip ./maillog.3.gz
echo ' .'
echo -n ' filtering'
awk '{$1="";$2="";$3="";$4="";$5="";print}' ./maillog.3 | matchup
>>./matchup.out
echo ' .'
echo preprocessing maillog.2
echo -n ' copying'
cp $LogLoc/maillog.2.gz .
echo ' .'
echo -n ' unpacking'
gunzip ./maillog.2.gz
echo ' .'
echo -n ' filtering'
awk '{$1="";$2="";$3="";$4="";$5="";print}' ./maillog.2 | matchup
>>./matchup.out
echo ' .'
echo preprocessing maillog.1
echo -n ' copying'
cp $LogLoc/maillog.1.gz .
echo ' .'
echo -n ' unpacking'
gunzip ./maillog.1.gz
echo ' .'
echo -n ' filtering'
awk '{$1="";$2="";$3="";$4="";$5="";print}' ./maillog.1 | matchup
>>./matchup.out
echo ' .'
echo preprocessing maillog.0
echo -n ' copying'
cp $LogLoc/maillog.0.gz .
echo ' .'
echo -n ' unpacking'
gunzip ./maillog.0.gz
echo ' .'
echo -n ' filtering'
awk '{$1="";$2="";$3="";$4="";$5="";print}' ./maillog.0 | matchup
>>./matchup.out
echo ' .'
echo preprocessing maillog
echo -n ' copying'
cp $LogLoc/maillog .
echo ' .'
echo -n ' unpacking'
echo -n ' not needed'
echo ' .'
echo -n ' filtering'
awk '{$1="";$2="";$3="";$4="";$5="";print}' ./maillog | matchup
>>./matchup.out
echo ' .'
echo cleaning up
echo -n ' removing maillog.7'
rm maillog.7
echo ' .'
echo -n ' removing maillog.6'
rm maillog.6
echo ' .'
echo -n ' removing maillog.5'
rm maillog.5
echo ' .'
echo -n ' removing maillog.4'
rm maillog.4
echo ' .'
echo -n ' removing maillog.3'
rm maillog.3
echo ' .'
echo -n ' removing maillog.2'
rm maillog.2
echo ' .'
echo -n ' removing maillog.1'
rm maillog.1
echo ' .'
echo -n ' removing maillog.0'
rm maillog.0
echo ' .'
echo -n ' removing maillog'
rm maillog
echo ' .'