I need to logrotate logs in directories in /var/log/httpd/.
There are 4 directories in /var/log/httpd/... these directories are
/var/log/httpd/access/
Each of the access, required, error and debug directories have around 20 to 30 access log files of different locations for example:mumbai-access.log, pune-access.log etc..same is the case for 'error' dir 'required' dir and 'debug' dir in /var/log/httpd/ I need to clean up the logfiles in all the 4 directories access, error, debug and required... I have made a custom logrotate file as follows:
Answer: The following will rotate on weekly and it will keep last 4 log files and all other old compressed logs will be removed automatically. Code: "/var/log/httpd/access/*.monitor.com-access_log" "/var/log/httpd/error/*.monitor.com-error_log"
"/var/log/httpd/request/*.monitor.com-ssl_request_log" "/var/log/httpd/debug/*.monitor.com-rw_log"
Above /sbin/service is compatible with centos / rhel / fedora linux. For other distro use direct /etc/init.d/ path.
Have a Linux Problem
Linux Books
Linux Home: Linux System Administration Hints and Tips (c) www.gotothings.com All material on this site is Copyright.
|