1、分割nginx日志
vim /etc/logrotate.d/nginx
/var/log/nginx/*log {
create 0644 nginx nginx
rotate 10
missingok
notifempty
compress
sharedscripts
postrotate
/bin/kill -USR1 `cat /run/nginx.pid 2>/dev/null` 2>/dev/null || true
endscript
}

2、php-fpm日志
vim /etc/logrotate.d/php-fpm
/var/log/php-fpm/*.log {
missingok
daily
rotate 60
compress
nodelaycompress
notifempty
create 644 php-fpm nobody
sharedscripts
postrotate
/bin/kill -SIGUSR1 `cat /run/php-fpm.pid 2>/dev/null` 2>/dev/null || true
endscript
}

相关文章:

  • 2021-11-21
  • 2021-09-01
  • 2022-12-23
  • 2021-09-23
  • 2021-11-16
  • 2022-12-23
  • 2022-01-18
  • 2021-07-08
猜你喜欢
  • 2022-03-03
  • 2021-06-28
  • 2021-06-04
  • 2022-03-03
  • 2022-02-16
  • 2022-12-23
  • 2022-01-04
相关资源
相似解决方案