Created
December 15, 2017 10:50
-
-
Save marinsagovac/d2d71976ba4dc488fb0a87c8d507f65c to your computer and use it in GitHub Desktop.
Logrotate unix
This file contains 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
LOGROTATE CENTOS | |
================ | |
INFO | |
==== | |
Check is logrotate active: | |
cat /etc/cron.daily/logrotate | |
A log rotate command is: | |
/usr/sbin/logrotate | |
Example of script that executes by daily: | |
/etc/cron.daily/logrotate | |
Main log configuration | |
======================= | |
cat /etc/logrotate.conf | |
A typical logrotate for HTTP server is under: | |
cat /etc/logrotate.d/httpd | |
Add custom log into HTTP service | |
================================ | |
vi /etc/logrotate.d/httpd | |
Add a custom log: | |
/var/www/html/*log { | |
minsize 50M | |
rotate 4 | |
create | |
missingok | |
sharedscripts | |
delaycompress | |
postrotate | |
/sbin/service httpd reload > /dev/null 2>/dev/null || true | |
endscript | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment