Browse Source

new: [apache/log-rotate] can configure the rotation count from ``compose.yml``.

postgres
Valentin Lab 8 years ago
parent
commit
ea0f1f9337
  1. 5
      apache/hooks/log_rotate-relation-joined

5
apache/hooks/log_rotate-relation-joined

@ -14,6 +14,9 @@ LOGS=/var/log/apache2
# return 1
# }
rotated_count=$(relation-get rotated-count 2>/dev/null) || true
rotated_count=${rotated_count:-52}
## XXXvlab: a lot of this intelligence should be moved away into ``logrotate`` charm
DST="$CONFIGSTORE/$TARGET_SERVICE_NAME/etc/logrotate.d/$SERVICE_NAME"
file_put "$DST" <<EOF
@ -26,7 +29,7 @@ file_put "$DST" <<EOF
dateyesterday
dateformat _%Y-%m-%d
extension .log
rotate 52
rotate $rotated_count
compress
delaycompress
notifempty

Loading…
Cancel
Save