国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > Python > 正文

python批量同步web服務器代碼核心程序

2019-11-25 18:14:34
字體:
來源:轉載
供稿:網友
#!/usr/bin/env python #coding:utf8 import os,sys import md5,tab from mysql_co.my_db import set_mysql from ssh_co.ssh_connect import sshd from ssh_co.cfg.config import ssh_message,item_path from file import findfile def my_mysql():   db_file={}   my_connect=set_mysql()   f_file=findfile.main(item_path)   list_file=findfile.file_list(f_file)   see_file=my_connect.display_db()   for knumber,kname,ksgin,ksize,katime,kmtime in see_file:     db_file[kname]=[ksgin,ksize,katime,kmtime]   for fname,fsize,fatime,fmtime in list_file:       if fname in db_file.keys():         if ("%f")%fmtime == ("%f")%db_file[fname][3]:           print "%s The same mtime pass"%fname           my_connect.set_file_attribute(10,fname,fmtime)           pass        else:           print "%s different for mtime"%fname           my_connect.set_file_attribute(11,fname,fmtime)       else:         my_connect.add_db(fname,fsize,fatime,fmtime)         my_connect.set_file_attribute(11,fname,fmtime)         print "%s,is new file"%fname   new_file=my_connect.new_db()   my_connect.disconn_db()   return new_file def my_ssh(new_file):   pid_host = 1  for host_attribute in ssh_message:     ssh_conn=sshd(host_attribute,pid_host)     for file_name in new_file:       if file_name:         a=ssh_conn.put_ssh_file(file_name[1])         print a         print "ssh_connect memoryID: %s" %pid_host       else:         pid_host = id(host_attribute)         ssh_conn.disconn_ssh() def main():   new_file=my_mysql()   my_ssh(new_file)  if __name__ == "__main__":   main()
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 永年县| 如东县| 峨边| 定边县| 武鸣县| 峡江县| 西乌| 芜湖县| 日照市| 平乡县| 常熟市| 大田县| 龙江县| 新疆| 玉溪市| 峡江县| 莎车县| 广西| 手游| 肃宁县| 江油市| 秭归县| 神木县| 正镶白旗| 德化县| 霍山县| 石阡县| 昌宁县| 上杭县| 上饶县| 繁昌县| 察雅县| 宜昌市| 贡山| 额敏县| 卫辉市| 会昌县| 霸州市| 伽师县| 武冈市| 宁阳县|