Operating System - HP-UX
1753580 Members
6319 Online
108796 Solutions
New Discussion юеВ

Re: a log file has a so big size ! even large then the filesystem!

 
SOLVED
Go to solution
avizen9
Esteemed Contributor

Re: a log file has a so big size ! even large then the filesystem!

HI,
can you please post bdf output,

what is output for file quwue_10.err
Ganesan R
Honored Contributor

Re: a log file has a so big size ! even large then the filesystem!

Hi,

Could you try to kill the process which is using the file if it is not impact anything?

#fuser -ku quwue_10.err
Best wishes,

Ganesh.
Dennis Handly
Acclaimed Contributor

Re: a log file has a so big size ! even large then the filesystem!

>1. How can I reduce the file, or make the ll show as normal

Why? The sparse file is working fine.
Note: doing xd on the file will expand it.
Matti_Kurkela
Honored Contributor
Solution

Re: a log file has a so big size ! even large then the filesystem!

If a program writes into a log file, it should always perform a "fseek(file, 0, SEEK_END);" or a similar operation before each write, as the administrator may have truncated the log file between the writes. Closing the file after each write and re-opening it only when needed would work too.

If the program does not do this operation and the sysadmin truncates the log file, it will result in exactly what you've experienced.

A file with 131 GB of zero bytes at the beginning is inconvenient to process: some text manipulation tools may give up because the file is just too big to handle.

Some programs include a way of signaling them to indicate that its log files have been truncated. See the documentation of your program: if your program has this feature, use it immediately after truncating the file (unless the documentation suggests a different procedure).

If there is no way to tell the program that the file has been cleared, the only way to fix this is:
1.) Stop the program that writes into the file.
2.) Clear the file (just as before, using # > queue_10.err or similar)
3.) Restart the program.

When the program opens the file after the restart, it will read the new size of the file. After that the file should again work normally, without a long string of zero bytes in the beginning.

MK
MK