Logs are important and usefull in security and administration. If a log grows too much, you compress it , back it up for some months or years and create a new log file. All this is done in a much better way by Logrotate. Logrotate enables you to compress the old logfile, and store it for as long as you want, to run every day, montly, or when you want, and if a file expires, it can send it to you by email or delete it, after for example, 2 years. Old logs can be stored in an alternative directory.
You set up logs configuring /etc/logrotate.conf or adding a new file in /etc/logrotate.d/
For example, a logrotate file for apache looks like this:
File: /etc/logrotate.d/httpd
-------8<-------
/usr/local/apache/logs/*log {
missingok
notifempty
sharedscripts
postrotate
/bin/kill -USR1 `cat /var/run/httpd.pid 2>/dev/null` 2> /dev/null || true
endscript
}
Subscribe to:
Post Comments (Atom)
Complete list of recommended VS Code extensions for writing and managing AWS Terraform scripts , including syntax checking, variable supp...
-
# Ansible module and some advance options Modules: Command: This module help you to execute commands to the target host, it may be comma...
-
=================== Deployment ================= 1.) Deployment without any nodeName or nodeSelector, pod will spread among all of the av...
-
# Ansible gathering facts from remote servers. ============================= ====================================== getting facts fro...
No comments:
Post a Comment