Docker日志清理
#创建脚本
vim dockerlogrm.sh
#!/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 ========"
sh dockerlogrm.sh
评论区