Saltstack Official Logrotate Formula
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
1.6KB

  1. # -*- coding: utf-8 -*-
  2. # vim: ft=yaml
  3. ---
  4. logrotate:
  5. # default OS values can be overridden in 'lookup' dict
  6. # lookup:
  7. # pkg: logrotate
  8. # service: crond
  9. default_config:
  10. weekly: true
  11. rotate: 52
  12. create: true
  13. compress: true
  14. dateext: true
  15. jobs:
  16. /tmp/var/log/mysql/error:
  17. config:
  18. - weekly
  19. - missingok
  20. - rotate 52
  21. - compress
  22. - delaycompress
  23. - notifempty
  24. - create 640 root adm
  25. - sharedscripts
  26. mysql:
  27. path:
  28. - /tmp/var/log/mysql/*.log
  29. config:
  30. - weekly
  31. - missingok
  32. - rotate 52
  33. - compress
  34. - delaycompress
  35. - notifempty
  36. - create 640 root adm
  37. - sharedscripts
  38. syslog:
  39. path:
  40. - /var/log/cron
  41. - /var/log/maillog
  42. - /var/log/messages
  43. - /var/log/secure
  44. - /var/log/spooler
  45. - /var/log/slapd.log
  46. config:
  47. - sharedscripts
  48. - postrotate
  49. - /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
  50. - endscript
  51. nginx:
  52. contents: |
  53. /var/log/nginx/*.log{
  54. weekly
  55. missingok
  56. compress
  57. delaycompress
  58. notifempty
  59. create 0640 www-data adm
  60. sharedscripts
  61. prerotate
  62. if [ -d /etc/logrotate.d/httpd-prerotate ]; then \
  63. run-parts /etc/logrotate.d/httpd-prerotate; \
  64. fi \
  65. endscript
  66. postrotate
  67. invoke-rc.d nginx rotate >/dev/null 2>&1
  68. endscript
  69. }