需求:统计当前修改的html文件中的https 的url,通过rsysnc 推送到email服务器,转发到指定邮箱
1.python版
#! /usr/bin/env python
# -*- coding:utf-8 -*-# Author :zyb
import os
import re
import time
file=os.popen('find /home/wwwroot/html -type f -mtime -1|grep "html$"')
with open('url-%s.txt'%(time.strftime('%Y-%m-%d')),'w') as f2:
for html in file:
html=html.strip()
with open(html,'r') as f:
f2.write("=============================================================\t\n")
f2.write("file:%s"%html.encode('utf-8')+'\t\n'