Rsync Plus SSH Config

Rsync Plus SSH Config

Sometimes you need to use settings from the ssh config file or in my case a custom config file.  Here is a quick note on how I did it.

Example without SSH config just using the key and user@publicIP

$ pwd
/home/rrossouw/.ssh

$ rsync -avz --exclude "env-vars" -e "ssh -i /media/sf_DATA/ssh-keys/oci-mgmt" /media/sf_DATA/src/terraform/* opc@pu.blic.ip:~/terraform/
sending incremental file list
devtest/lb_private.tf

sent 2,650 bytes  received 91 bytes  1,096.40 bytes/sec
total size is 1,343,000  speedup is 489.97

Example with SSH config

$ pwd
/home/rrossouw/.ssh

$ rsync -avz --exclude "env-vars" -e "ssh -F My-config" /media/sf_DATA/src/terraform/* jump01:~/terraform/
sending incremental file list

sent 2,607 bytes  received 32 bytes  1,759.33 bytes/sec
total size is 1,343,000  speedup is 508.90

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.