Skip to content

Commit 01e1df2

Browse files
committed
logrotate the ever-growing docker logs (google#1156)
1 parent 4a7f84d commit 01e1df2

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

cloud/google/node_init.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,15 @@ EOF
5959
sudo cp /tmp/ct-info.conf /etc/google-fluentd/config.d/ct-info.conf
6060
sudo service google-fluentd restart
6161
# End google-fluentd stuff
62+
63+
cat > /etc/logrotate.d/docker <<EOF
64+
/var/log/docker.log {
65+
rotate 7
66+
daily
67+
compress
68+
size=1M
69+
missingok
70+
delaycompress
71+
copytruncate
72+
}
73+
EOF

0 commit comments

Comments
 (0)