Search code examples
rsyncscp

scp to rsync conversion


The following is working as expected.

scp -o IdentityFile=/home/companyuser/.ssh/id_dsa_fner {} [email protected]:/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/  [email protected]:/home/fner/ 

I use find -exec >> scp to 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.


Solution

  • you might try specifying the transfer type with -e

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