首页
学习
活动
专区
圈层
工具
发布
  • 您找到你想要的搜索结果了吗?
    是的
    没有找到

    python实现磁盘日志清理

    print(translate_time_interval_to_second('7d')) ''' 关断文件是否可能是当前log文件 1) 修改改时间1天内 2) 以pattern结尾 ''' def probable_current_log_file...        return True     return str(file_path).endswith(pattern)   ''' 获取超过天数设置log,注意不会返回可能是当前正在修改的文件,查看probable_current_log_file...= -1 \                 and not probable_current_log_file(candidate_file_fullpath):                 #  ... and file_modify_in(candidate_file_fullpath, time_interval=modify_in)) and \             #      not probable_current_log_file...remove_file_list(file_list,pattern='log',roll_back=False):     for file_item in file_list:         if roll_back or probable_current_log_file

    1.4K10
    领券