ERROR RSYNC “STDIN: IS NOT A TTY”

Recently we tried to establish an SSH connection from our VPS to a Shared Hosting environment trying to download some backup files via rsync. The process was successful but with one error notification: 

stdin: is not a tty.

To fix this issue follow the steps below:
Login to your server where you wish to run rsycn 
Go to the home directory of your user account.

cd /home/username

But normally, each time we logged in, We should automatically be in that user home directory.

Now edit a file named .bashrc using your favorite editor

nano .bashrc

Now add below line to the top of your .bashrc file:

[ -z "$PS1" ] && return

Now save that file and exit.
Done,now you will not encounter this error anymore.