Run Rsync from Python

This question already has an answer here:

  • Calling an external command in Python 50 answers

  • You can call a subprocess from python using the following snippet

    import subprocess
    subprocess.call(["ls", "-l"])
    

    In your case, it would be something like this

    subprocess.call(["rsync", "-Ccavz", "--delete","DJStatic", "username@website"])
    

    See here for more details.

    链接地址: http://www.djcxy.com/p/13490.html

    上一篇: 如何运行另一个python程序,而不会阻止原创?

    下一篇: 从Python运行Rsync