2 Star 0 Fork 0

shine_forever / pyTest

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
test.py 1.32 KB
一键复制 编辑 原始数据 按行查看 历史
shine_forever 提交于 2014-02-08 17:20 . just test.py
#! /usr/bin/env python
#coding:utf-8
#written by guolt;
import sys,os
from hashlib import md5
"""
squid push and del files!
cdn.tag文件状态说明:
1:正在上传;
2:上传完成;
3:正在分发;
4:分发完成;
"""
cdn_base='/u01/cdnLog'
tag_file=cdn_base+'/cdn.tag'
push_list=cdn_base+'/push.list'
del_list=cdn_base+'/del.list'
#download_dir="/usr/local/cdn_download"
cdn_log=cdn_base+'/cdn.log'
cdn_tmp=cdn_base+'/cdn_tmp/'
cdn_host_ip={'idc-cdn1.wuxi.jl':'58.215.80.133','idc-cdn2.wuxi.jl':'58.215.80.134'}
cdn_url="test.grandes.com.cn"
def getTag(self):
tagfile=open(self,'r')
for tag in tagfile.readlines():
if tag.rstrip('\n') == '1':
print "tag: 1."
else:
print "hello"
def del_file(self):
"""
"""
for cdn_host,ip in cdn_host_ip.items():
print cdn_host
delFile=open(self,'r')
for delList in delFile.readlines():
delList=delList.rstrip('\n')
print delList
print u'开始purge url.........'
print "hostname:%s DelFile: %s" %(cdn_host,delList)
os.system('/usr/sbin/squidclient -h %s -p 80 -m PURGE http://%s/%s' %(cdn_host,cdn_url,delList))
#print "###"*20
#print delList
delFile.close()
#getTag(tag_file)
del_file(del_list)
Python
1
https://gitee.com/shine_forever/pyTest.git
git@gitee.com:shine_forever/pyTest.git
shine_forever
pyTest
pyTest
master

搜索帮助