On 1/7/09 10:15 AM, Mark Post wrote:
On 1/7/2009 at 5:44 AM, John Summerfield<deb...@herakles.homelinux.org>
wrote:
-snip-
logrotate expects you're logging sensibly. John is not.
"sensibly" means the program can close and reopen the logfile on demand.
That is not a requirement for logrotate. If nothing else the "copytruncate"
parameter will do what is desired. I had to wind up using that for ntpd, since it never
closes its log file, and any signals ntpd gets result in it shutting down.
Right, but copytruncate doesn't create sparse files when it's rotating
old generations (i.e., it probably reads the file and creates real \x00
where there was sparse-ness):
$ du -csxB1 /tmp/t3*
397312 /tmp/t3
1277952 /tmp/t3.1
135168 /tmp/t3.2
8192 /tmp/t3.logrotate
4096 /tmp/t3.sparse
8192 /tmp/t3.state
1830912 total
$ du -csxB1 --apparent-size /tmp/t3*
1654180 /tmp/t3
1267728 /tmp/t3.1
126808 /tmp/t3.2
43 /tmp/t3.logrotate
1048576000000 /tmp/t3.sparse
48 /tmp/t3.state
1048579048807 total
t3 is the current (and, coincidentally, closed) log, and is sparse
(397312 <= 1654180), but t3.1 (1277952 >= 1267728) and t3.2 (135168 >=
126808) aren't. Real sparse files like t3.sparse (4096 <= 1048576000000)
are almost always smaller than their apparent size.
- Larry
----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390