docker 清除容器日志 .sh脚本

1年前 ⋅ 68 阅读
#!/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 ========" 

全部评论: 0

    我有话说: