Subject: Useful perl scripts... [1084]

From: [email-masked] (Dave Williss)
Date: Wed, 11 Jan 1995 08:53:17 -0600 (CST)

The next two messages from me will be some rather useful perl scripts
that I wrote.  

The first one, dumpxfer, takes the /usr/adm/xferlog and prints it
out in a more readable format.  It breaks the listing up into incoming
and outgoing sections with special sections listing incoming transfers
to any place other than the incoming directory (shouldn't happen if your
setup is correct) and outgoing transfers from the incoming directory
(maybe somebody using your incoming directory to transfer 100's of
gif's?).  The report output is formatted like...

  b /pub/incoming/cqu_aus/BELMONT.RVC        [email-masked] (138.77.17.160)

Where the "b" is either "b" or "a".  The address is what the user gave as
their password.  If they failed to give an "@" sign, it will append the
address of where they came from.  Finally, the address in parenthesis is
the address they came from if it doesn't match what they said it was.

The 2nd script is designed to be run by root's cron.  It could be run
by somebody else, as long as that somebody has write permission to the
xferlog file.  It copies the current xferlog to a LOGS subdirectory 
and renames it with todays date.  It then truncates the main xferlog.  
After doing this, it runs dumpxfer (the first script) and redirects its 
output to a temp file.  If the file is > 0 bytes long, it mails it to
a user (or users) listed at the top of the script.  

We have this setup to mail the transfer log to our tech-support staff
every morning.  That way when a user calls in and complains that "that
bug-fix I downloaded didn't even load", tech support can look at the log
and say "That's because you downloaded it in ASCII mode.  Didn't you
read the message that came up when you cd'd into the directory?"  We also
have users send us data that causes problems in our software package.
Ocassionally, one will upload it ASCII and we have to have them upload
it again.  Sometimes they just put the file in the incoming directory
with no indication as to what it is, who sent it or anything.  This 
helps track them down.

-- 
David C. Williss    			    #include <standard.disclaimer>
Software Engineer -- MicroImages, Inc.		[email-masked]
WWW: http://tnt.microimages.com/~dwilliss       [email-masked]
-- PGP Public Key available via finger from: [email-masked] --