Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Strange ls problem 1

Status
Not open for further replies.

mrn

MIS
Apr 27, 2001
3,993
GB
New one on me AIX 5.2with JFS2.

We have a log file that fills quite often I've created a script that watchs the file. When it gets to 1Gb cp it to a different file system compress it & empty the original using > filename.

Now after doing this du & df show the space has been recovered but ls show the file at the same size. The file is being written to by around 20-30 different processes.

Any Ideas?

Mike

"A foolproof method for sculpting an elephant: first, get a huge block of marble, then you chip away everything that doesn't look like an elephant."

 
Because it is being written to it has an open file descriptor, and until that file descriptor is closed you will have abnormalities like you are seeing.
 
Would a sync update the file decriptor, if not can I force an update?

Mike

"A foolproof method for sculpting an elephant: first, get a huge block of marble, then you chip away everything that doesn't look like an elephant."

 
Until the file is closed and reopened, the proces(es) writing to the file write at the address it was (they were) at. This means that all of a sudden the file contains a number of unallocated blocks (sparse file).

Try the fileplace command on the file. You'll see the unallocated blocks.


HTH,

p5wizard
 
Ok Thanks,

This is causing me a major headache. The original logrotate script moved the file then touched a new one which to my mind wasn't a good thing considering the activity on this file (a ULOG from tuxedo with full debug). Any other suggestion on the best way to manage this file. The system is using a 32-bit kernel so I'm trying to avoid the 2Gb limit.



Mike

"A foolproof method for sculpting an elephant: first, get a huge block of marble, then you chip away everything that doesn't look like an elephant."

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top