background : In our daily work, one is based on centos It's a mirror image python Crawler program , The log file arrived in two months 500G, Logs are stored in the root directory , Solve this problem without expansion . By means of timed tasks and scripts , Clean up the log files in the container regularly . The core command of the script :

docker exec -i a62927a71762 find / -type f -name "*.dd*" -size +10M -exec rm -fr {} \;
# -i     Interactive
# find   It's an order to execute
#  The general meaning is to put / The name in the directory contains characters .dd And greater than 10M Delete the file of .

Combined with the timing task to execute this command .