Linux-Docker日志清理

https://www.aliyun.com/minisite/goods?userCode=66ilo1gr
#!/bin/sh

echo "==================== start clean docker containers logs =========================="

logs=$(find /var/lib/docker/containers/ -name *-json.log)

for log in $logs
        do
                echo "clean logs : $log"
                cat /dev/null > $log
        done


echo "==================== end clean docker containers logs   =========================="

admin

作者并不想留下任何信息~~~~~~~~~~~哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈

留下你的评论

*评论支持代码高亮<pre class="prettyprint linenums">代码</pre>

相关推荐