Showing posts with label rotate. Show all posts
Showing posts with label rotate. Show all posts

Thursday, June 27, 2024

Keep current log file when using logrotate

When using logrotate in Linux, you might encounter a situation where your log file gone when the log rotated. One of the flag that you may need to notice is the copytruncate flag. It did not remove the current log file, instead it copy the log file and then truncate it:

File name: /etc/logrotate.d/your-application

 /var/log/your-application/output.log {
    copytruncate
    rotate 5
    daily 
    compress
    delaycompress
    notifempty
    missingok
}


Upgrade nodejs in conda (from v18 to v26)

If your conda env is nodejs v18, doing a conda install nodejs=26 is likely to create a lot of conflict. Consider remove those conflicting p...