#!/usr/bin/env python # Filename: backup_ver1.py
import os import time source=[r'D:\python\test',r'D:\python\test1'] target_dir='D:\\python\\test2\\' #Remember to change this to what you will be using target=target_dir+time.strftime('%Y%m%d%H%M%S')+'.zip'
zip_command = "zip -qr %s %s" % (target, ' '.join(source))
if os.system(zip_command)==0: print 'Successful backup to',target else: print 'Backup FAILED'