On the Source server.
ssh-keygen -b 4096cat ~/.ssh/id_rsa.pubOn the Destination server, paste the content of ~/.ssh/id_rsa.pub into ~/.ssh/authorized_keys.
nano ~/.ssh/authorized_keysIf ~/.ssh/ doesn't exist, create the directory.
mkdir ~/.sshchmod 0700 ~/.sshnano ~/.ssh/authorized_keyschmod 0644 ~/.ssh/authorized_keysOn the Source server.
rsync -avz -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --progress /SOURCE USER@IP_ADDRESS:/DESTNOTE: If SOURCE is a directory, exclude the directory name is DEST
Specify identity file without depending on ~/.ssh/id_rsa
rsync -avz -e "ssh -i IDENTITY_KEY.pem -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --progress /SOURCE USER@IP_ADDRESS:/DESTExclude files for rsync
rsync -avz -e "ssh -i IDENTITY_KEY.pem -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --progress /SOURCE USER@IP_ADDRESS:/DEST --exclude "*.pyc" --exclude "__pycache__" --exclude ".git" --exclude ".gitignore"