分类: Python/Ruby
2013-05-02 16:25:50
from subprocess import call
import sys
import time
import os
source='test01'
target='test01'+time.strftime('%Y%m%d%H%M%S')+'.zip'
zip="zip"
arguments="-qvr"
cmd="%s %s %s %s "%(zip,arguments,target,source)
def zip():
ret=call(cmd,shell=True)
if ret!=0:
print "zip faild!"
sys.exit(1)
else:
print "success"
zip()