毎日のログの回転中に次のエラーが発生します。
/usr/bin/find: cannot delete ‘/var/log/tomcat/catalina.out’: Permission denied error: error running non-shared postrotate script for /var/log/tomcat/xdlogger.log of '/var/log/tomcat/*.log'
これが私のlogrotate構成です。
# cat /etc/logrotate.d/tomcat
/var/log/tomcat/*.txt
/var/log/tomcat/*.log
/var/log/tomcat/catalina.out {
copytruncate
daily
dateext
rotate 3
compress
missingok
postrotate
/usr/bin/find /var/log/tomcat/ -type f ! -name 'catalina.out' -mtime +5 -delete
endscript
}
catalina.outとxdlogger.logの権限は次のとおりです。
# stat /var/log/tomcat/catalina.out
File: `/var/log/tomcat/catalina.out'
Size: 16061 Blocks: 32 IO Block: 4096 regular file
Device: fd05h/64773d Inode: 41 Links: 1
Access: (0755/-rwxr-xr-x) Uid: ( 70/ www) Gid: ( 0/ root)
Access: 2019-07-11 03:17:16.056809957 -0500
Modify: 2019-07-11 07:14:48.331588384 -0500
Change: 2019-07-11 07:14:48.331588384 -0500
# stat /var/log/tomcat/xdlogger.log
File: `/var/log/tomcat/xdlogger.log'
Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: fd05h/64773d Inode: 1433 Links: 1
Access: (0755/-rwxr-xr-x) Uid: ( 70/ www) Gid: ( 70/ www)
Access: 2019-07-11 03:17:16.044810362 -0500
Modify: 2019-07-11 03:17:16.044810362 -0500
Change: 2019-07-11 03:17:16.044810362 -0500
どこで間違っているのか教えてください。