I need to do rsync by ssh and want to do it automatically without the need of passing password for ssh manually.
rsync
ssh
Use a ssh key.
Look at ssh-keygen and ssh-copy-id.
ssh-keygen
ssh-copy-id
After that you can use an rsync this way :
rsync -a --stats --progress --delete /home/path server:path