truncate log file in Progress V8

tjsingh

Member
Hi

I need to truncate my log file. I am working in Version 8 but prolog command does not work

This needs to be done while databases are running. I am working SCO UNixware 7.1.1.

any ideas?

regards

TJ
 

tjsingh

Member
cheers worked a treat just another one

how about if i wanted to keep the last 100 lines in the .lg file can this be done?
 

sphipp

Member
Code:
tail -100 dbname.lg > dbname.lg.tmp
cat dbname.lg.tmp > dbname.lg
rm dbname.lg.tmp

You could try
Code:
tail -100 dbname.lg > dbname.lg.tmp
mv dbname.lg.tmp dbname.lg
which is a bit shorter and might work.
 

TomBascom

Curmudgeon
You can't successfully mv the .lg file and have it work the way that you hope. Since the db is "live" the file handle is being held open by various processes which means that their messages will continue going to that file (the file name that you see in a directory listing is just a "tag" of sorts for the file, the file doesn't go away until the last process having an open handle to it closes it...).

The "tail" command with redirection will mostly work but there will be two (short) periods of time when messages might get written that will either become garbled or missed. If that doesn't bother you then go for it. (It wouldn't bother me very much.)
 
Top