1
0
Fork 0
mirror of synced 2024-12-21 21:51:09 -05:00

Merge pull request #64 from netmanagers/master

fix(conf): add 'monthly' interval
This commit is contained in:
Imran Iqbal 2022-03-28 19:30:01 +01:00 committed by GitHub
commit ad7bbf8a8b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 29 additions and 1 deletions

View file

@ -23,7 +23,7 @@ no{{ parameter }}
# See "man logrotate" for details.
# log files rotation period
{% for period in ['hourly', 'daily', 'weekly', 'yearly'] -%}
{% for period in ['hourly', 'daily', 'weekly', 'monthly', 'yearly'] -%}
{{ set_parameter(period) }}
{%- endfor %}

View file

@ -35,6 +35,18 @@ logrotate:
- notifempty
- create 640 root adm
- sharedscripts
a_monthly_job:
path:
- /tmp/var/log/a_service/*.log
config:
- monthly
- missingok
- rotate 12
- compress
- delaycompress
- notifempty
- create 640 root adm
- sharedscripts
syslog:
path:
- /var/log/cron

View file

@ -88,3 +88,19 @@ describe file('/etc/logrotate.hourly.d/nginx_high_traf') do
its('content') { should include 'postrotate' }
its('content') { should include 'kill -USR1 $(cat /var/run/nginx_high_traf.pid)' }
end
describe file('/etc/logrotate.d/a_monthly_job') do
it { should be_file }
it { should be_owned_by 'root' }
it { should be_grouped_into 'root' }
its('mode') { should cmp '0644' }
its('content') { should include '/var/log/a_service/*.log' }
its('content') { should include 'monthly' }
its('content') { should include 'missingok' }
its('content') { should include 'rotate 12' }
its('content') { should include 'compress' }
its('content') { should include 'delaycompress' }
its('content') { should include 'notifempty' }
its('content') { should include 'create 640 root adm' }
its('content') { should include 'sharedscripts' }
end