Saltstack Official Logrotate Formula
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

98 行
2.3KB

  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. a_monthly_job:
  39. path:
  40. - /tmp/var/log/a_service/*.log
  41. config:
  42. - monthly
  43. - missingok
  44. - rotate 12
  45. - compress
  46. - delaycompress
  47. - notifempty
  48. - create 640 root adm
  49. - sharedscripts
  50. syslog:
  51. path:
  52. - /var/log/cron
  53. - /var/log/maillog
  54. - /var/log/messages
  55. - /var/log/secure
  56. - /var/log/spooler
  57. - /var/log/slapd.log
  58. config:
  59. - sharedscripts
  60. - postrotate
  61. - /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
  62. - endscript
  63. nginx_high_traf:
  64. path:
  65. - /var/log/nginx_high_traf/*.log
  66. config:
  67. - hourly
  68. - missingok
  69. - rotate {{ 30 * 24 }} # keep 1 month's worth of hourly logs
  70. - compress
  71. - notifempty
  72. - dateext
  73. - dateformat .%Y-%m-%d-%H00
  74. - olddir /var/log/nginx_high_traf/archive
  75. - sharedscripts
  76. - postrotate
  77. - 'kill -USR1 $(cat /var/run/nginx_high_traf.pid)'
  78. - endscript
  79. nginx:
  80. contents: |
  81. /var/log/nginx/*.log{
  82. weekly
  83. missingok
  84. compress
  85. delaycompress
  86. notifempty
  87. create 0640 www-data adm
  88. sharedscripts
  89. prerotate
  90. if [ -d /etc/logrotate.d/httpd-prerotate ]; then \
  91. run-parts /etc/logrotate.d/httpd-prerotate; \
  92. fi \
  93. endscript
  94. postrotate
  95. invoke-rc.d nginx rotate >/dev/null 2>&1
  96. endscript
  97. }