I need to do rsync by ssh and want to do it automatically without the need of passing password for ssh manually.
rsync
ssh
You can avoid the password prompt on rsync command by setting the environment variable RSYNC_PASSWORD to the password you want to use or using the --password-file option.
RSYNC_PASSWORD
--password-file