Linux syslog backup
Component: logrotate
Config file: /etc/logrotate.conf
Content: default for all log files
1. The period of change file
2. Keep time
Schedule job: /etc/cron.daily/logrotate
Target objects: /etc/logrotate.d
Customerize the log file
Example: apache
The apache is install with binary package
The location of the software is /user/local/httpd
Change the /etc/logrotate.d/httpd:
/usr/local/httpd/log/* {
daily --> make new file everyday
rotate 60 --> keep 60 days log
missingok --> no alert when no log file
notifempty --> if empty no need to create file
sharescripts --> everyday run one time
olddir /httpd/logbackup --> keep the old log into the path
postrotate
/usr/local/httpd/bin/apachectl reload ... --> reload the program
endscript
}
Comments
Post a Comment