When you are connecting to a remote server using ssh (for rsync, or other remote functions), and are receiving ‘stdin: is not a tty’ error messages in your log files, it is most likely because your remote shell is trying to execute something which needs to run interactively, when you are not in an interactive mode.
Simply add the following line to the top of your .bashrc:
[ -z "$PS1" ] && return
This will cause bash to check and see if it is running interactively or not, and if it is not, it will halt processing of the configuration file, preventing the rest of the file from executing code which could possibly generate this error when in non-interactive mode.