Index: modules/nginx/templates/logrotate.erb |
diff --git a/modules/nginx/templates/logrotate.erb b/modules/nginx/templates/logrotate.erb |
index b957e92b2e22781ebf69ce5f3b6c22d369a1f104..abbd3b78d92553c9bee42def52991d7fbeff6ee2 100644 |
--- a/modules/nginx/templates/logrotate.erb |
+++ b/modules/nginx/templates/logrotate.erb |
@@ -8,5 +8,11 @@ |
sharedscripts |
postrotate |
[ ! -f /var/run/nginx.pid ] || kill -USR1 `cat /var/run/nginx.pid` |
+ test ! -e /var/log/nginx/<%= @log %>.2.gz || \ |
+ zcat /var/log/nginx/<%= @log %>.2.gz \ |
+ | /usr/local/bin/anonymize-access-log \ |
+ --geolite2-db /usr/share/GeoIP/GeoLite2-Country.mmdb \ |
+ --salt <%= scope.function_shellquote([@log_salt]) %> \ |
+ | gzip -9 > /var/log/archive/<%= @log %>.`date +%Y-%m-%d`.gz |
endscript |
} |