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