Garry Conn

How to fix the bash: rsync: command not found error

In the process of setting up an automatic web server backup I discovered that there was an issue with rsync. I noticed after getting everything setup, backups were not being made to my remote server. Through troubleshooting I discovered this issue:

I searched around quite a bit on Ubuntu, Debian and a few other message board sites and what seems to be fairly common is the obvious getting overlooked. I really hate that for people because it can be so frustrating.

At any rate, if you are getting the same or similar error as shown below, it might be due to the fact that the server you are trying to pull the data from does not have rsync installed. That was the case for me. Immediately after installing: apt-get install rsync on the other server everything worked perfectly.

bash: rsync: command not found
rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]
rsync error: error in rsync protocol data stream (code 12) at io.c(601) [Receiver=3.0.7]

Both servers need to have rsync installed. That probably seems obvious to many. The mystery for me is figuring out how rsync got removed from my local server. I ran the script a few times before signing off and it was working fine. So somehow rsync got removed from my local server. My remote server couldn't sync the data on the local server because rsync was not installed. Anyway, I hope this helps you. If not, you are welcome to post a comment below. I will do what I can to help you.