thegeekstuff has an example about logrotate. copytruncate will copy and truncate the original log file. Then why we should use create? The original log file has not been removed.
/tmp/output.log {
size 1k
copytruncate
create
compress
compresscmd /bin/bzip2
compressext .bz2
rotate 4
maxage 100
}
Another question is what is the use of maxage 100? The rotate 4 directive will delete old log files after 4 rotation.
man logrotateeven says so: "copytruncate: [...] When this option is used, the create option will have no effect, as the old log file stays in place." – Ulrich Schwarz Mar 5 '12 at 8:16