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 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)