例子find /opt/soft/log/ -mtime +30 -name "*.log" -exec rm -rf {} \;说明将/opt/soft/log/目录下所有30天前带".log"的文件删除。具体参数说明如下:find:linux的查找命令,用户查找指定条件的文件;/opt/soft/log/:想要进行清理的任意目录;-mtime:标准语句写法;+30:查...
import os import time import multiprocessing from logging.handlers import TimedRotatingFileHandler from logging import FileHandler lock = multiprocessing.Lock() class SafeLog(TimedRotatingFileHan...