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!"