python批量同步web服务器代码核心程序
python
#!/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()
登录后复制
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章
R.E.P.O.能量晶体解释及其做什么(黄色晶体)
2 周前
By 尊渡假赌尊渡假赌尊渡假赌
仓库:如何复兴队友
1 个月前
By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island冒险:如何获得巨型种子
4 周前
By 尊渡假赌尊渡假赌尊渡假赌
击败分裂小说需要多长时间?
3 周前
By DDD
R.E.P.O.保存文件位置:在哪里以及如何保护它?
3 周前
By DDD

热工具

记事本++7.3.1
好用且免费的代码编辑器

SublimeText3汉化版
中文版,非常好用

禅工作室 13.0.1
功能强大的PHP集成开发环境

Dreamweaver CS6
视觉化网页开发工具

SublimeText3 Mac版
神级代码编辑软件(SublimeText3)

关于Linux系统自带Python解释器的删除问题许多Linux发行版在安装时会预装Python解释器,它并非通过软件包管理器�...

使用自定义装饰器时的Pylance类型检测问题解决方法在Python编程中,装饰器是一种强大的工具,可以用于添加行�...

Python3.6环境下加载pickle文件报错:ModuleNotFoundError:Nomodulenamed...

Python异步库之间的兼容性问题在Python中,异步编程已经成为处理高并发和I/O...

使用信号杀死父进程时,子进程继续运行的问题及解决方案在Python编程中,通过信号杀死父进程后,子进程仍然...

Python3.6环境下加载Pickle文件报错:ModuleNotFoundError:Nomodulenamed...
