在我的CentOS 6.5上,logrotate归档dateext归档日志文件
几个站点正在运行,我分别设置日志目录。 loglotate每周工作,但结果不好。它每周再次存档已存档的日志。
这里是/etc/logrotate.d/sites文件。
/home/site1/logs/httpd/* /home/site2/logs/ httpd/* /home/site3/logs/httpd/* {
copytruncate
weekly
rotate 4
missingok
notifempty
dateext
}
和文件列表上的/ home/siate1 /日志/ httpd的
-rw-r--r-- 1 root root 35100863 May 14 17:37 site1-access_log
...
-rw-r--r-- 1 root root 0 Apr 27 03:29 site1-access_log-20140413-20140420
-rw-r--r-- 1 root root 0 May 4 03:24 site1-access_log-20140413-20140420-20140427
-rw-r--r-- 1 root root 0 May 11 03:35 site1-access_log-20140413-20140420-20140427-20140504
-rw-r--r-- 1 root root 70221784 May 11 03:35 site1-access_log-20140413-20140420-20140427-20140504-20140511
-rw-r--r-- 1 root root 0 Apr 27 03:29 site1-access_log-20140420
-rw-r--r-- 1 root root 0 May 4 03:24 site1-access_log-20140420-20140427
-rw-r--r-- 1 root root 0 May 11 03:35 site1-access_log-20140420-20140427-20140504
-rw-r--r-- 1 root root 69335598 May 11 03:35 site1-access_log-20140420-20140427-20140504-20140511
-rw-r--r-- 1 root root 0 May 4 03:24 site1-access_log-20140427
-rw-r--r-- 1 root root 0 May 11 03:35 site1-access_log-20140427-20140504
-rw-r--r-- 1 root root 68505478 May 11 03:35 site1-access_log-20140427-20140504-20140511
-rw-r--r-- 1 root root 0 May 11 03:35 site1-access_log-20140504
-rw-r--r-- 1 root root 68772871 May 11 03:35 site1-access_log-20140504-20140511
-rw-r--r-- 1 root root 68054687 May 11 03:35 site1-access_log-20140511
-rw-r--r-- 1 root root 24701 May 14 16:54 site1-error_log
...
-rw-r--r-- 1 root root 0 Apr 27 03:29 site1-error_log-20140413-20140420
-rw-r--r-- 1 root root 0 May 4 03:24 site1-error_log-20140413-20140420-20140427
-rw-r--r-- 1 root root 0 May 11 03:35 site1-error_log-20140413-20140420-20140427-20140504
-rw-r--r-- 1 root root 109645452 May 11 03:35 site1-error_log-20140413-20140420-20140427-20140504-20140511
-rw-r--r-- 1 root root 0 Apr 27 03:29 site1-error_log-20140420
-rw-r--r-- 1 root root 0 May 4 03:24 site1-error_log-20140420-20140427
-rw-r--r-- 1 root root 0 May 11 03:35 site1-error_log-20140420-20140427-20140504
-rw-r--r-- 1 root root 43345 May 11 03:35 site1-error_log-20140420-20140427-20140504-20140511
-rw-r--r-- 1 root root 0 May 4 03:24 site1-error_log-20140427
-rw-r--r-- 1 root root 0 May 11 03:35 site1-error_log-20140427-20140504
-rw-r--r-- 1 root root 84371 May 11 03:35 site1-error_log-20140427-20140504-20140511
-rw-r--r-- 1 root root 0 May 11 03:35 site1-error_log-20140504
-rw-r--r-- 1 root root 38442 May 11 03:35 site1-error_log-20140504-20140511
-rw-r--r-- 1 root root 31182 May 11 03:35 site1-error_log-20140511
问题是什么?
此问题可能属于serverfault.com。 –