Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Trim logs?? Help!

0 views
Skip to first unread message

Larry Rekow

unread,
Jun 10, 1995, 3:00:00 AM6/10/95
to
I'm trying to find a way to trim the uucico and mail logs periodically.
Not just deleting them, but trimming them to just show the past few days
or something. I know the schedule file can schedule things like this,
but what program do I use to trim the logs?

Thanks if you can help.

Larry Rekow

Johannes Blankenstein

unread,
Jun 11, 1995, 3:00:00 AM6/11/95
to
lre...@netcom.com (Larry Rekow) writes:
>
> I'm trying to find a way to trim the uucico and mail logs periodically.
> Not just deleting them, but trimming them to just show the past few days
> or something. I know the schedule file can schedule things like this,
> but what program do I use to trim the logs?

I'm using a program KILL_LOG.EXE by Stefan Reck. It keeps the last nnn
lines of a given file. I can send it to you if you like.

Hannes

--
Johannes Blankenstein; Berlin; Germany
INET: jb...@giraffe.in-berlin.de

b...@guug.de

unread,
Jun 13, 1995, 3:00:00 AM6/13/95
to lre...@netcom.com, b...@guug.de

In article <lrekowD9...@netcom.com>, <lre...@netcom.com> writes:
>
> I'm trying to find a way to trim the uucico and mail logs periodically.
> Not just deleting them, but trimming them to just show the past few days
> or something. I know the schedule file can schedule things like this,
> but what program do I use to trim the logs?
>
> Thanks if you can help.
>
> Larry Rekow


I use something like this:

tail -400 %1 >temp
rename %1. %1.%2
rename temp %1.


where %1 is the log name, %2 is the last digit of the year,
and followed by two-digit number of the month just over, e.g.
506 for June, 1995.

tail.exe is a ported <unix> tool (in case you're running DOS,
aren't you ? which can be found in many packages, like DOSNIX,
and similar. Sorry, do not have a ftp location handy, but they're
very common.

Purodha


Bli

unread,
Jun 13, 1995, 3:00:00 AM6/13/95
to
From: b...@guug.de In article <lrekowD9...@netcom.com>, <lre...@netcom.com> writes: > I'm trying to find a way to trim the uucico and mail logs periodically. > Not just deleting them, but trimming them to just show the past few days > or something. I know the schedule file can schedule things like this, > but what program do I use to trim the logs? > Thanks if you can help. > Larry Rekow I use something like this: tail -400 %1 >temp rename %1. %1.%2 rename temp %1. where %1 is the log name, %2 is the last digit of the year, and followed by two-digit number of the month just over, e.g. 506 for June, 1995. tail.exe is a ported <unix> tool (in case you're running DOS, aren't you ? which can be found in many packages, like DOSNIX, and similar. Sorry, do not have a ftp location handy, but they're very common. Purodha --------------------------------------------------- * The Blues Cafe! Dallas, Tx. Home of BigD Online * * Dallas' Best BBS List! (214) 638-1181 8 Lines! * ---------------------------------------------------

Russell Schulz

unread,
Jun 15, 1995, 3:00:00 AM6/15/95
to
jb...@giraffe.in-berlin.de (Johannes Blankenstein) writes:

>> I'm trying to find a way to trim the uucico and mail logs periodically.

> I'm using a program KILL_LOG.EXE by Stefan Reck. It keeps the last nnn


> lines of a given file.

I, personally, use this:

in schedule:

32 06 * * * call trimlogs

trimlogs.bat:

i:
cd \
anyfree 128
if errorlevel 1 goto done

cd \waffle\admin
copy uucp.018 uucp.019
copy uucp.017 uucp.018
copy uucp.016 uucp.017
copy uucp.015 uucp.016
copy uucp.014 uucp.015
copy uucp.013 uucp.014
copy uucp.012 uucp.013
copy uucp.011 uucp.012
copy uucp.010 uucp.011
copy uucp.009 uucp.010
copy uucp.008 uucp.009
copy uucp.007 uucp.008
copy uucp.006 uucp.007
copy uucp.005 uucp.006
copy uucp.004 uucp.005
copy uucp.003 uucp.004
copy uucp.002 uucp.003
copy uucp.001 uucp.002
copy uucp uucp.001
del uucp

anyfree 128
if errorlevel 1 goto done

cd \waffle\admin
copy cron.003 cron.004
copy cron.002 cron.003
copy cron.001 cron.002
copy cron cron.001
del cron
cd \

:done
diskfree
echotime

this way I know I have 5 days of cron and 20 days of uucp, which is
more to my liking than some fixed number of lines. (and is easily
done with command.com, too)
--
Russell Schulz rus...@alpha3.ersys.edmonton.ab.ca ersys!rschulz Shad 86c

Purodha B. Blissenbach

unread,
Jun 15, 1995, 3:00:00 AM6/15/95
to
In article <lrekowD9...@netcom.com>, <lre...@netcom.com> writes:

> I'm trying to find a way to trim the uucico and mail logs periodically.

> Not just deleting them, but trimming them to just show the past few
days
> or something. I know the schedule file can schedule things like this,
> but what program do I use to trim the logs?
>
> Thanks if you can help.
>
> Larry Rekow

Assuming you are not using unix, are you ?
I use a batch similar to this:

Rem %0 -- trim a Waffle log.
rename %1. %1.%3
tail -%2 %1.%3 >%1.


where %1 is the name of the log to be trimmed, e.g. uucico.
and %3 is a unique extension for any decade, last digit of
year followed by two digit number of month just beginning,
i.e. 506 for June, 1995. %2 is the number of lines to be
kept as an overlap. The above is called from another batch
like this:


Rem %0 -- trim all waffle logs at midnight before a new month.
k:
cd k:\waffle\admin
if exist uucico call trim uucico 400 %1
if exist callers call trim callers 10 %1
if exist errors call trim errors 10 %1
if exist logfail call trim logfail 20 %1
etc.


You might have to make some adjustments for your installation.

The tail command used above can be found in many popular
packages that implement unix tools for DOS users. I do
not recall where I got mine, but here are two, just quoted
out of my memory:

ftp://ftp.uni-koeln.de/msdos/unixlike/uznix120.zip 340.087 bytes
ftp://ftp.uni-koeln.de/msdos/unixlike/uxutl23.zip 865.134 bytes

Do not blame me, if the path above is incorrect; both file names and
machine name are certainly correct, however. The /ftp.uni-koeln.de/
ftp archive is recommendable anyway, just shop around.

Purodha

Michiel Dethmers

unread,
Jun 17, 1995, 3:00:00 AM6/17/95
to
> jb...@giraffe.in-berlin.de (Johannes Blankenstein) writes:
>
> >> I'm trying to find a way to trim the uucico and mail logs periodically.
>
> > I'm using a program KILL_LOG.EXE by Stefan Reck. It keeps the last nnn
> > lines of a given file.
>
> I, personally, use this:
>
> in schedule:
>
> 32 06 * * * call trimlogs
>
> trimlogs.bat:
>
[ cutting lots and lots ]

Why so difficult? Just use the following:

Some Ross Lazarus made it for free use! ;-)
It is distributed in the file w165peg9.zip, a UDG for Waffle and Pegasusmail.

Michiel

Russell Schulz

unread,
Jun 18, 1995, 3:00:00 AM6/18/95
to poster
Ick, what broken software! no References: header, no attribution to me.
and it's pmail, so it sent two messages for one included file (I've
noticed this before)

I'd guess pegasusmail isn't a good newsreader.

mic...@dethmers.xs4all.nl (Michiel Dethmers) writes:

>> trimlogs.bat:
>
> [ cutting lots and lots ]
>
> Why so difficult?

I said why in the part you didn't quote.

- only requires command.com
- no more applications on the disk
- highly portable
- I keep `n' days' worth, not `n' lines' worth (why would I want n lines?)
- I hardly think 20 ``copy foo.000 foo.001'' lines is difficult

Russell Schulz

unread,
Jun 18, 1995, 3:00:00 AM6/18/95
to poster
Russell...@alpha3.ersys.edmonton.ab.ca (Russell Schulz) writes:

> mic...@dethmers.xs4all.nl (Michiel Dethmers) writes:
>
>> Why so difficult?

and another reason: the trimlog you posted discards the old log, and
you have to specify the size-to-keep in kilobytes. with a 20-line
batch file, I keep the last 20 days' worth in separate files. I like
that, and would not be able to come close to that with trimlog.exe

Wolfgang Reinfeldt

unread,
Jul 3, 1995, 3:00:00 AM7/3/95
to
>In article <lrekowD9...@netcom.com>, <lre...@netcom.com> writes:
>>
>> I'm trying to find a way to trim the uucico and mail logs periodically.
>> Not just deleting them, but trimming them to just show the past few days
>> or something. I know the schedule file can schedule things like this,
>> but what program do I use to trim the logs?
>>
>> Thanks if you can help.
>>
>> Larry Rekow

My solution is posting the contents of the log files to a local
newsgroup:

The following lines are included in poll.bat, but it could be any
other batch file that is executed regularly:

g:\waffle\bin\rnews -nadmin -s"Polling uniol" < g:\waffle\admin\uucp
del g:\waffle\admin\uucp

So I have every recent information available in the newsgroup admin,
and what is even better, I feed this newsgroup to my computer at home.

In fact because it's so easy, I've added more information into the
log using the additional line

uuq >> g:\waffle\admin\uucp

and other similar stuff.

Wolfgang

--
----------------------------------------------------------------
Wolfgang Reinfeldt (teacher) Caecilienschule Oldenburg Germany
e-mail: rei...@caeci.ol.ni.schule.de phone: +49-441-45595
School's phone: +49-441-71377 fax: +49-441-7775213
----------------------------------------------------------------

Jim Grubs, W8GRT

unread,
Jul 8, 1995, 3:00:00 AM7/8/95
to
-----BEGIN PGP SIGNED MESSAGE-----

In article <lrekowD9...@netcom.com>, <lre...@netcom.comwrites:

>I'm trying to find a way to trim the uucico and mail logs periodically.
>Not just deleting them, but trimming them to just show the past few days
>or something. I know the schedule file can schedule things like this,
>but what program do I use to trim the logs?

I have a maintenance routine batch file which runs the first thing after
midnight. It runs a whole slew of routines including renaming certain files,
such as uucico, mailbox.*, etc., to new names containing the Julian day
number of the previous day.

Here it is. It is, by the way, heavily 4DOS specific.

:MAINT
fax
unalias copy
unalias del
unalias move
c
lock
u
daynbr /-1 ren mailbox.* mail@###.*
ww
daynbr /-1 ren bgfax.log bgfaxlog.@###
wa
daynbr /-1 ren uucico uucico.@###
daynbr /-1 ren mail mail.@###
sm
copy prz-list \
copy htmllist \
wb
if not exist \%_doy htmindex
if not exist \%_doy setindex
htmdigst
digest
>\%_doy
ship-set
set-html
call shiphtml
call ship
procc all
u
explode
ww
copy \user\jgrubs\foo.* \news\talk\politics\crypto\* \news\sci\crypt\* c:\spool\mail\asp*.* c:\waffle\newkey.txt
del c:\pgp\nukeys.*
pgp -ka +batchmode=on +force c:\waffle\newkey.txt c:\pgp\nukeys
move c:\spool\mail\asp*.* f:\pub\privacy\
move c:\spool\mail\html*.* f:\pub\htmllist\
del c:\waffle\newkey.txt
u
del foo.*
\pgp\
pgp -kxa * nukeys.asc c:\pgp\nukeys.pgp +armorlines=0
c:\waffle\bin\rmail -fjg...@voxbox.norden1.com -sadd keyservr < c:\pgp\nukeys.asc
wb
expire
nn
defrag

-----BEGIN PGP SIGNATURE-----
Version: 2.6.2
Comment: http://norden1.com/~jim/sylvania.html

iQCVAwUBL/8sEN74r4kaz3mVAQHrfgP/Yihjrxhpm2yRcmizOLcCv+xdtRJBWuDs
GlCV1iZEyt6XvI2DoucUvNAoqvKfS10Gh6pzh8w1unIDy8Iriw1+SZzi4PbfJHG2
q0IlPRNvdQ8vu7EY4zcVgZwRgRbLD44FZUR2CP64ieHcRiHAIrdoexKDy/O/eYSD
Xie0Eb0hhCQ=
=quvn
-----END PGP SIGNATURE-----


"Those that give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety." -- Benjamin Franklin (1773)

0 new messages