Files
RsyslogAutomate/automateRsync.py
2024-04-13 12:36:16 +02:00

13 lines
393 B
Python

import os
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 = "test.txt"
dest = "/home/userpi/"
user = "userpi"
host = "victor.raspberrypi"
rsyncConection(src, dest, user, host)