BBBinary BuddiesDevelopmentOct 19, 20265 min read0 views

Atomically Copy and Truncate a Log File on Linux

Copy then truncate leaves a gap where appended lines vanish. Rename closes it but only if the writer reopens its file. Here is what each workaround costs.

Share this article

file-copyfilesystemslinuxlog rotationrenametruncate

Comments