#!/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 =========================="
公司的服务是用的docker ,发现磁盘man了,然后执行上面的命令就搞定了