Configurated to work with public/private key

This commit is contained in:
victor
2024-04-13 12:36:16 +02:00
parent 5724752202
commit ef13a6049e

View File

@@ -1,13 +1,13 @@
import os
def rsyncConection(src, dest, user, host, password_file):
conn = f"rsync --rvpog --times --atimes --update --delete {src} {user}@{subprocess.call(["ls", "-l"])}:{ruta_final}"
def rsyncConection(src, dest, user, host):
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)
if __name__ == "__main__":
src = ""
dest = ""
user = ""
host = ""
password_file = ""
rsyncConection(src, dest, user, host, password_file)
src = "test.txt"
dest = "/home/userpi/"
user = "userpi"
host = "victor.raspberrypi"
rsyncConection(src, dest, user, host)