You are here: Re: Trimming a large log file? « PHP Programming Language « IT news, forums, messages
Re: Trimming a large log file?

Posted by David T. Ashley on 11/30/06 15:56

"David T. Ashley" <dta@e3ft.com> wrote in message
news:giCbh.3572$xf7.2887@fe81.usenetserver.com...
> The solution you proposed above probably has race conditions.
> Specifically, if a log entry is made (by another process) at the points
> I've marked with an asterisk above, you will lose some lines from the log
> file.

Also, if you're seeing this problem for the first time, this might help:

http://en.wikipedia.org/wiki/Race_condition

The operating system will assign CPU time to processes in unpredictable
patterns, so if one process stops running and the other goes at the points
I've marked with an asterisk ...

The "mv" solution is robust because Unix was designed that way ... the
solution you proposed probably has a race conditions that may cause log file
lines to be lost.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация