开发者

scp to rsync conversion

开发者 https://www.devze.com 2023-03-11 05:40 出处:网络
The following is working as expected. scp -o IdentityFile=/home/companyuser/.ssh/id_dsa_fner {} companyuser@14.140.100.189:/home/fner/

The following is working as expected.

scp -o IdentityFile=/home/companyuser/.ssh/id_dsa_fner {} companyuser@14.140.100.189:/home/fner/ 

But the rsync version of the same command does not work:

rsync -av -o IdentityFile=/home/companyuser/.ssh/id_dsa_fner /home/companyuser/  companycuser@14.140.100.189:/home/fner/ 

I use find -exec >> scp to开发者_如何学JAVA copy files in the first example. I can copy all the files in one location. But rsync will allow me to have the same directory structure on destination exactly like master host.


you might try specifying the transfer type with -e

rsync -avze "ssh -o IdentityFile=/path/to/file" /sync/here/ root@remotehost:/to/here
0

精彩评论

暂无评论...
验证码 换一张
取 消