Advertisement
kazeuraki

/etc/logrotate.d/

Nov 23rd, 2017
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. Dành cho file /etc/logrotate.d/nginx
  2. /home/*/logs/access.log /home/*/logs/error.log /home/*/logs/nginx_error.log {
  3. #create 640 nginx nginx
  4. daily
  5. compress
  6. rotate 5
  7. maxage 7
  8. missingok
  9. notifempty
  10. sharedscripts
  11. delaycompress
  12. postrotate
  13. [ -f /var/run/nginx.pid ] && kill -USR1 `cat /var/run/nginx.pid`
  14. endscript
  15. #su nginx nginx
  16. }
  17.  
  18. Dành cho file /etc/logrotate.d/php-fpm
  19. /home/*/logs/php-fpm*.log {
  20. daily
  21. compress
  22. rotate 5
  23. maxage 7
  24. missingok
  25. notifempty
  26. sharedscripts
  27. delaycompress
  28. postrotate
  29. /bin/kill -SIGUSR1 `cat /var/run/php-fpm/php-fpm.pid 2>/dev/null` 2>/dev/null || true
  30. endscript
  31. }
  32.  
  33. Xong chạy lệnh logrotate -vf /etc/logrotate.conf
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement