Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dành cho file /etc/logrotate.d/nginx
- /home/*/logs/access.log /home/*/logs/error.log /home/*/logs/nginx_error.log {
- #create 640 nginx nginx
- daily
- compress
- rotate 5
- maxage 7
- missingok
- notifempty
- sharedscripts
- delaycompress
- postrotate
- [ -f /var/run/nginx.pid ] && kill -USR1 `cat /var/run/nginx.pid`
- endscript
- #su nginx nginx
- }
- Dành cho file /etc/logrotate.d/php-fpm
- /home/*/logs/php-fpm*.log {
- daily
- compress
- rotate 5
- maxage 7
- missingok
- notifempty
- sharedscripts
- delaycompress
- postrotate
- /bin/kill -SIGUSR1 `cat /var/run/php-fpm/php-fpm.pid 2>/dev/null` 2>/dev/null || true
- endscript
- }
- Xong chạy lệnh logrotate -vf /etc/logrotate.conf
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement