I need to run an rsync command from Python. Is this possible and if so, how do I do it?
rsync -Ccavz --delete DJStatic username@website
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With