sbin/sync/fabfile.py
changeset 6 5514662f70af
parent 4 8e3ace50b235
child 17 f8c613e43ebd
equal deleted inserted replaced
5:2d4996beea62 6:5514662f70af
    40                  "print settings.%s" % (settings_key)])
    40                  "print settings.%s" % (settings_key)])
    41             res = run("python < %s" % (tempfilepath))
    41             res = run("python < %s" % (tempfilepath))
    42         run("rm -f \"%s\"" % (tempfilepath))
    42         run("rm -f \"%s\"" % (tempfilepath))
    43     return res
    43     return res
    44 
    44 
    45     
       
    46 def rsync_export(path, remotepath, filters):
    45 def rsync_export(path, remotepath, filters):
    47     print("Rsync %s to %s",(path,remotepath))
    46     print("Rsync %s to %s",(path,remotepath))
    48     
    47     
       
    48     filter_option_str = "--progress --stats"
    49     if filters:
    49     if filters:
    50         filter_option_str = " ".join(["--filter \"%s\"" % (f) for f in filters])
    50         filter_option_str += " " + " ".join(["--filter \"%s\"" % (f) for f in filters])
    51     else:
       
    52         filter_option_str =""
       
    53     
    51     
    54     run("mkdir -p \"%s\"" % remotepath)
    52     run("mkdir -p \"%s\"" % remotepath)
    55     rsync_project(remotepath, local_dir=path, extra_opts=filter_option_str, delete=True)
    53     rsync_project(remotepath, local_dir=path, extra_opts=filter_option_str, delete=True)
    56     print("Rsync %s to %s done",(path,remotepath))
    54     print("Rsync %s to %s done",(path,remotepath))
    57     
    55