Pregunta

I'm running the below script from the command line with this:

os.system("rsync -avrz -e \'ssh -i /root/.ssh/keyfile.pem\' /var/www/" + folder_name + " root@server.com:" + destfoldertosync)

and I get this when I print out the rsync:

rsync -avrz -e 'ssh -i /root/.ssh/keyfile.pem' /var/www/folder_name, root@server.com:/var/www/destfoldertosync

"/var/www/folder_name," is breaking rsync. It works fine with the folder name hardcoded in there. Why is it inserting a comma after the path and how can I stop it from doing that?

Note: I can't use paramiko so I want this to work with os.system.

¿Fue útil?

Solución

I made the mistake of separating the parameters by commas on the cli. Now it works.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top