python 备份脚本


import os
import time
source= r"out_res.txt"
target_dir= r"F:\python\Doc"
target=target_dir+time.strftime('%Y%m%d%H%M%S')+'.zip'
zip_commond="makecab %s %s " %(source,target)
print '\n Run the backup:',
print zip_commond+'\n'
if os.system(zip_commond)==0:
print 'Successful backup to ',target
else:
print 'Backup Failed.'

posted on 2014-07-23 10:05  a_badegg  阅读(123)  评论(0编辑  收藏  举报

导航