./rsync.sh
sudo: sorry, you must have a tty to run sudo
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(601) [sender=3.0.7]
Solution edit
/etc/sudoers
#Defaults requiretty
sudo, tty, rsync, sh, unexpectedly, bytes, sender, protocol, stream, io, edit, etc, sudoers, defaults, requiretty,