Created
January 27, 2020 16:38
-
-
Save vidyasonawane/0a13deb808ff4a939296cb9f133f349a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/var/log/nginx/*.log { | |
weekly | |
missingok | |
rotate 52 | |
compress | |
delaycompress | |
notifempty | |
} | |
Notes for reference: | |
/var/log/nginx is the directory where the log files are stored. | |
*.log : all files having .log extension. | |
weekly : rotate on weekly basis | |
missingok : if any log file is missing, do not worry and continue | |
rotate 52 : 52 is the number of files you want to retain | |
compress : compress the files | |
delaycompress : don't compress the most recent log file | |
notifempty : don't rotate if logfile is empty |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
copytruncate
we can also add copytruncate which copies the existing log files and then it truncates the current one.