Thanks if you can help.
Larry Rekow
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
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
>> 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
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
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
> 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
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
----------------------------------------------------------------
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)