Skip to content

Instantly share code, notes, and snippets.

@almoraes
Created January 2, 2018 17:34
Show Gist options
  • Save almoraes/47a02e2832129dc8c5ffebac045774f8 to your computer and use it in GitHub Desktop.
Save almoraes/47a02e2832129dc8c5ffebac045774f8 to your computer and use it in GitHub Desktop.
EB AWS rotate docker logs
files:
"/etc/logrotate.elasticbeanstalk.hourly/logrotate.elasticbeanstalk.dockerlogs.conf":
mode: "000644"
owner: root
group: root
content: |
/var/lib/docker/containers/*/*.log {
size 100M
rotate 14
missingok
compress
notifempty
copytruncate
dateext
dateformat %s
}
"/etc/cron.hourly/cron.logrotate.elasticbeanstalk.dockerlogs.conf":
mode: "000755"
owner: root
group: root
content: |
#!/bin/sh
test -x /usr/sbin/logrotate || exit 0
/usr/sbin/logrotate /etc/logrotate.elasticbeanstalk.hourly/logrotate.elasticbeanstalk.dockerlogs.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment