If you want to make it automatic you must cover some basics.
1st rsync connects trough ssh. You have to make sure the user, which you will use for rsyncing has ssh key installed on the remote computer (i will use user "root" as example).
2nd make a decision how exactly you will rsyncing (from the server to the backup-server ot from the backup-server to the server)
I'll do it as the script is running on the backup server.
now your server will connect to the remote server without asking for password.
from here you can make something like this :
## Rsync script
rsync -auvz root@server-ip:/path/to/directory/ /backup-server/path/to/backup/
be aware of the fact that :
1. if you place a "/" at the end of the paths it means "syncronize the CONTENT of that directory"
( /path/to/dir/ )
2. if you don't place a "/" it will rsync the whole directory
( /path/to/dir )