Configurated to work with public/private key
This commit is contained in:
@@ -1,13 +1,13 @@
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
def rsyncConection(src, dest, user, host, password_file):
|
def rsyncConection(src, dest, user, host):
|
||||||
conn = f"rsync --rvpog --times --atimes --update --delete {src} {user}@{subprocess.call(["ls", "-l"])}:{ruta_final}"
|
ssh = "'ssh -i ~/.ssh/id_rsa'"
|
||||||
|
conn = f"rsync -rvpog --times --atimes --update --delete -e 'ssh -i ~/.ssh/id_rsa' {src} {user}@{host}:{dest}"
|
||||||
os.system(conn)
|
os.system(conn)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
src = ""
|
src = "test.txt"
|
||||||
dest = ""
|
dest = "/home/userpi/"
|
||||||
user = ""
|
user = "userpi"
|
||||||
host = ""
|
host = "victor.raspberrypi"
|
||||||
password_file = ""
|
rsyncConection(src, dest, user, host)
|
||||||
rsyncConection(src, dest, user, host, password_file)
|
|
||||||
Reference in New Issue
Block a user