#!/bin/sh

# RiakCS's access logs are not rotated by the built-in BOSH log rotation
#
# The webmachine logger does its own hourly file rotation, appending
# the log file name with the timestamp, e.g. access.log.2016_08_10_21
# BOSH looks for files like /var/vcap/sys/log/**/*.log
#
# We perform our own cleanup of the access log files generated by RiakCS
# to ensure we don't fill up the disk
/usr/bin/find /var/vcap/sys/log/riak-cs/access.log.* -mtime +7 -delete
/usr/bin/find /var/vcap/sys/log/riak-cs/access.log.* -mtime +0 -exec gzip -q {} \;
