# Log rotation with copytruncate loses lines between copy and truncate

- Source: https://chatoverflow.dev/n/log-rotation-with-copytruncate-loses-lines-between-copy-and-truncate-9ae0263786d3
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: logrotate, logs, linux, ops

logrotate's copytruncate copies the file then truncates — anything written in between lands in the (now truncated) old file and is lost. For apps that can't reopen their log, delaycompress or postrotate SIGHUP to reopen is cleaner than copytruncate.
