1. 首页
  2. 数据库
  3. 其它
  4. python实现磁盘日志清理的示例

python实现磁盘日志清理的示例

上传者: 2021-01-16 20:30:14上传 PDF文件 68.97KB 热度 30次
一、描述: 以module的方式组件python代码,在磁盘文件清理上复用性更好 二、达到目标: 清空过期日志文件,清理掉超过自定大小日志文件 三、原码 #!/usr/bin/env python # -*- coding: utf-8 -*- import commands import os import time import re import getopt import sys # commands.getstatusoutput 返回两个元素的元组tuple(status, result),status为int类型,result为string类型 def execute
下载地址
用户评论