I have a process running that writes standard output and standard error to a log file /var/log/dragonturtle.log. Is there anyway to rotate the log file, and have the process continuing to write to the new log file without killing the process?
What happens currently (given the logrotate config below):
- Process writes to
/var/log/dragonturtle.log - Logrotate moves
/var/log/dragonturtle.logto/var/log/dragonturtle.log.1 - Process continues to write to
/var/log/dragonturtle.log.1
What I would like to happen:
- Process writes to
/var/log/dragonturtle.log - Logrotate copies
/var/log/dragonturtle.logto/var/log/dragonturtle.log.1 - Logrotate truncates
/var/log/dragonturtle.log - Process continues to write to
/var/log/dragonturtle.log
/etc/logrotate.d/dragonturtle:
/var/log/dragonturtle.log {
daily
missingok
rotate 7
compress
delaycompress
notifempty
create 644 dragonturtle dragonturtle
}