Guest User

Untitled

a guest
Jul 7th, 2020
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. Here is the template:
  2.  
  3. <%= @log_path -%> {
  4. <%= @rotate_every %>
  5. rotate <%= @rotate_count %>
  6. compress
  7. <% if @delaycompress == true %>delaycompress
  8. <% end -%>missingok
  9. notifempty
  10. create <%= @create_mode -%> <%= @create_owner -%> <%= @create_group %>
  11. <% if @postrotate == true -%>postrotate
  12. <% @postrotate_cmd.each do |value| -%><%= value %>
  13. <% end -%>endscript<% end -%>
  14. }
  15.  
  16.  
  17.  
  18. When @postrotate is false the output looks like this. The `}` isn't to the left.
  19.  
  20. /var/log/auth.log {
  21. weekly
  22. rotate 4
  23. compress
  24. delaycompress
  25. missingok
  26. notifempty
  27. create 0644 root adm
  28. }
  29.  
  30. When @postrotate is true the output looks like this. The second `invoke commnad` should be a bit to the right and `}` should be on the new line to the left.
  31.  
  32. /var/log/auth.log {
  33. weekly
  34. rotate 4
  35. compress
  36. delaycompress
  37. missingok
  38. notifempty
  39. create 0644 root adm
  40. postrotate
  41. invoke-rc.d rsyslog reload > /dev/null
  42. invoke-rc.d rsyslog reload > /dev/null
  43. endscript}
  44.  
  45. Expected output when @postrotate is false:
  46.  
  47.  
  48. /var/log/auth.log {
  49. weekly
  50. rotate 4
  51. compress
  52. delaycompress
  53. missingok
  54. notifempty
  55. create 0644 root adm
  56. }
  57.  
  58. Expected output when @postrotate is true:
  59.  
  60.  
  61. /var/log/auth.log {
  62. weekly
  63. rotate 4
  64. compress
  65. delaycompress
  66. missingok
  67. notifempty
  68. create 0644 root adm
  69. postrotate
  70. invoke-rc.d rsyslog reload > /dev/null
  71. invoke-rc.d rsyslog reload > /dev/null
  72. endscript
  73. }
Add Comment
Please, Sign In to add comment