Windows 到 Linux(rsync 和 ssh)

Windows 到 Linux(rsync 和 ssh)

我正在尝试将 Windows 图片中的文件夹备份到远程 Linux 目录。

这就是我所拥有的:

rsync -av ssh /cygdrive/c/users/Owner/Pictures/ [email protected]:/var/files/ImageSync/

我从以下地方得到了这个格式:https://stackoverflow.com/questions/4182286/transferring-from-windows-to-linux-with-rsync

但我收到此错误:

rsync: link_stat "/home/Owner/ssh" failed: No such file or directory (2) rsync: change_dir "/cygdrive/c/users/Owner/Pictures" failed: No such file or directory (2) sent 20 bytes received 12 bytes 64.00 bytes/sec total size is 0 speedup is 0.00 rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1165) [sender=3.1.1]

ssh已经链接了密钥对,因此不需要密码。除非我做错了什么,这就是我遇到问题的原因。

我也尝试过:

rsync -av -e ssh /cygdrive/c/users/Owner/Pictures/ [email protected]:/var/files/ImageSync/

并得到同样的错误

答案1

在声明开关之前,您必须传递源文件夹-av -e

$ rsync /cygdrive/c/users/Owner/Pictures/ -av -e ssh [email protected]:/var/files/ImageSync/

相关内容