from subprocess import call
import sys
source="/TIVOLI/pythontest/" --注意最后 /是必须的 否则会 同步到pythontest1的子目录里面
target="/TIVOLI/pythontest1"
rsync="rsync"
arg="-a"
cmd="%s %s %s %s"%(rsync,arg,source,target)
def sync():
ret=call(cmd,shell=True)
if ret !=0:
print "rsync failed"
sys.exit(1)
sync()
阅读(450) | 评论(0) | 转发(0) |