Update rsync.py
Browse files
rsync.py
CHANGED
|
@@ -8,9 +8,9 @@ remote_port = "7072"
|
|
| 8 |
remote_path = "/sillytavern/"
|
| 9 |
password = "qilan"
|
| 10 |
|
| 11 |
-
# 构建 rsync
|
| 12 |
-
command = f"rsync -avzP -e 'ssh -p {remote_port}' {local_path} {remote_user}@{remote_host}:{remote_path}"
|
| 13 |
-
|
| 14 |
# 启动子进程并运行命令
|
| 15 |
child = pexpect.spawn(command)
|
| 16 |
|
|
@@ -21,4 +21,3 @@ child.sendline(password)
|
|
| 21 |
# 等待命令完成并输出结果
|
| 22 |
child.expect(pexpect.EOF)
|
| 23 |
print(child.before.decode()) # 输出 rsync 的结果
|
| 24 |
-
|
|
|
|
| 8 |
remote_path = "/sillytavern/"
|
| 9 |
password = "qilan"
|
| 10 |
|
| 11 |
+
# 构建 rsync 命令,添加 StrictHostKeyChecking=no
|
| 12 |
+
command = f"rsync -avzP -e 'ssh -o StrictHostKeyChecking=no -p {remote_port}' {local_path} {remote_user}@{remote_host}:{remote_path}"
|
| 13 |
+
|
| 14 |
# 启动子进程并运行命令
|
| 15 |
child = pexpect.spawn(command)
|
| 16 |
|
|
|
|
| 21 |
# 等待命令完成并输出结果
|
| 22 |
child.expect(pexpect.EOF)
|
| 23 |
print(child.before.decode()) # 输出 rsync 的结果
|
|
|