I've got a legacy app that is generating a huge lot of logs message.
I'd like to be able to rotate the file every minute (or so) but without loosing / truncating any message.
The app is not able to change of file by itself so I need to do it externally.
Surfing the net I've seen a lot of suggestion to use cp
followed by a cat /dev/null
but since my app is generating almost a continuous flow of messages some messages are lost during the process.
Do you have any ideas ?
cat /dev/null
is a popular still urban legend. It can be easily replaced by:
or even nothing, given the fact it is a no-op. – jlliagre May 28 '13 at 21:47logrotate -f config
? – nurettin Mar 19 '15 at 14:52