rsync WIN10到ubuntu 20.04异常
rsync: connection unexpectedly closed (0 bytes received so far) [sender] rsync error: error in rsync protocol data stream (code 12) at io.c(226) [sender=3.1.2]
下载了cwRsync免费版本然后参考 https://www.linuxidc.com/linux/2012-12/76874.htm
然后因为ssh与rsync同路径
且开一个terminal执行 where ssh发现很多 ssh
遂要求 添加 -e /usr/bin/ssh.exe 指定ssh
参考https://stackoverflow.com/questions/7261029/why-is-this-rsync-connection-unexpectedly-closed-on-windows
授权【貌似有的不需要】
rsync.exe -e /usr/bin/ssh.exe -av "/cygdrive/d/cwRsync/home/Joh********/.ssh/id_rsa.pub" root@95.***.***.***:.ssh/authorized_keys
测试上传
rsync.exe -avzhP -e /usr/bin/ssh.exe "/cygdrive/d/laragon/www/****api/" root@95.***.***.***:~/***api
上传数据库文件
rsync.exe -avzhP -e /usr/bin/ssh.exe "/cygdrive/c/users/***/documents/***api.sql" **er*@95.***.***.***:~/***api/***-api/docker-compose/mysql/***api.sql
上传图片
rsync.exe -avzhP -e /usr/bin/ssh.exe "/cygdrive/d/laragon/www/***api/storage/app/public/" **er*@95.***.***.***:~/***api/images/