Python指定文件备份工具
2018-07-20 来源:open-open
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!"
标签:
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点!
本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。
最新资讯
热门推荐