I do the following command
rsync -a toCopy/Read_Files/ toCopy/Test
and it works. However when I try through remote access :
rsync -a toCopy/Read_Files/ [email protected]:/NightTest/
I got the following message
sh: rsync: command not found
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(605) [sender=3.0.9]
Even though I followed instruction from this site
http://www.tecmint.com/rsync-local-remote-file-synchronization-commands/
section Copy a Directory from Local Server to a Remote Server
**See my answer to know what to do if you can't use rsync
I solved the problem using scp command instead, turned out one of the server didn't have rsync.
See this solution for scp command
https://serverfault.com/questions/264595/can-scp-copy-directories
For rsync, this may be useful if you have similar errors that I have but you have rsync on BOTH machine
rsync'ing files between two remote servers, get errors stating rsync command not found on remote server
The error was indeed pointing out to the fact that the remote machine did not have it :
This error was only occurring when doing it remotely, indicating that the remote machine was not able to find this command.