How do rsync from within a python script?

Posted by Viswa on Ask Ubuntu See other posts from Ask Ubuntu or by Viswa
Published on 2012-07-06T12:26:39Z Indexed on 2012/07/06 15:23 UTC
Read the original article Hit count: 453

Filed under:
|
|

I plan to move file from one system to another system. For this, I am using rsync command in linux terminal. It works fine. But I need to implement this command to python. I am very new in python, so I don't know the way of defining the rsync command. So please tell the steps to define it. This is my rsync command:

rsync -avrz /opt/data/filename root@ip:/opt/data/file

I need to implement this command in a python script.

© Ask Ubuntu or respective owner

Related posts about python

Related posts about shell