| 注册
请输入搜索内容

热门搜索

Java Linux MySQL PHP JavaScript Hibernate jQuery Nginx
LueOsburn
9年前发布

Python指定文件备份工具

file_store_sw_release.py    

#!/usr/bin/python    """  2015.07.07  store all the specified kind of files to the DEST  Edit by Grey  """    import os,re,time,shutil    def FileStore(file_kind,destination_directory):      file_list            = [f for f in os.listdir('.') if f.endswith(file_kind)]      for file in file_list:          time_backup      = time.strftime('%Y_%m_%d',time.localtime(time.time()))   new_file_name    = destination_directory + time_backup + file   shutil.copy2(file,new_file_name)    FileStore('.hex','E:/sw_release_store/')  FileStore('.rar','E:/sw_release_store/')  FileStore('.zip','E:/sw_release_store/')  print "All the files have been backuped!"