Commit bc2bf6aa by Han Su Kim

Changing logrotate to hourly

More changes to make logrotate hourly

Changes to tracking.log setup to match production

Changes referenced from @Feanil's suggestions

Typo

explicitly create /etc/logrotate.d/hourly directory

remove logrotate directory in templates

Fixing bugs, Ansible doesn't like multiple module calls in one area

Using special_time=hourly instead of hour=*

Adding back subdirectory layout for templates

Manually dropping file for cron.hourly

Typo

Changes to template, creating logrotate script to run hourly

Bug fix

Making sure old tracking.log config is removed
parent 22ceb19d
#!/bin/sh
test -x /usr/sbin/logrotate || exit 0
/usr/sbin/logrotate /etc/logrotate.d/hourly
......@@ -51,14 +51,23 @@
template: dest=/etc/rsyslog.d/99-edx.conf src=edx_rsyslog.j2 owner=root group=root mode=644
notify: restart rsyslogd
- name: Install logrotate configuration for edX
template: dest=/etc/logrotate.d/edx-services src=etc/logrotate.d/edx_logrotate.j2 owner=root group=root mode=644
# This is in common to keep all logrotation config
# in the same role
- name: Create hourly subdirectory in logrotate.d
file: path=/etc/logrotate.d/hourly state=directory
- name: Install logrotate configuration for tracking file
template: dest=/etc/logrotate.d/tracking.log src=etc/logrotate.d/edx_logrotate_tracking_log.j2 owner=root group=root mode=644
template: dest=/etc/logrotate.d/hourly/tracking.log src=etc/logrotate.d/hourly/edx_logrotate_tracking_log.j2 owner=root group=root mode=644
- name: Add logrotate for tracking.log to cron.hourly
copy: src=etc/cron.hourly/logrotate dest=/etc/cron.hourly/logrotate owner=root group=root mode=555
# This is transitional to allow older version of edx to update to new logrotate settings
- name: Remove old tracking.log config from /etc/logrotate.d
file: path=/etc/logrotate.d/tracking.log state=absent
- name: update /etc/hosts
template: src=hosts.j2 dest=/etc/hosts
......
{{ COMMON_LOG_DIR }}/*/edx.log {
create
compress
copytruncate
delaycompress
dateext
missingok
notifempty
daily
rotate 90
size 1M
}
{{ COMMON_LOG_DIR }}/tracking.log {
create
compress
delaycompress
dateext
missingok
notifempty
daily
rotate 365000
size 1M
}
{{ COMMON_LOG_DIR }}/tracking.log {
create
compress
delaycompress
create
dateext
dateformat -%Y%m%d-%s
missingok
nodelaycompress
notifempty
daily
rotate 365000
rotate 16000
size 1M
postrotate
/usr/bin/killall -HUP rsyslogd
endscript
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment