Replace your rsync command (assuming that you want to sync server1 with local server2)
with (type command on server2)
rsync -avz server1:/mail server2:/mail
To avoid password prompt you need to setup ssh-keys, so on server2 type following commands:
rsync -avrR --links --rsh=/usr/bin/ssh server1:/mail :/mail
Now you can login to server1 from server2 without password. Now setup cron job using following script (save script on server2):
ssh-keygen -t rsa
ssh you@server1 "mkdir .ssh"
scp .ssh/id_rsa.pub you@server1:.ssh/authorized_keys2
rsync -avrR --links --rsh=$SSH $MASTER:$DIR $LDIR
Setup cronjob using following syntax:
Script.sh will run at 6:01pm, 7:01pm, 8:01pm ... 2:01am
1 18,19,20,21,22,23,0,1,2 * * * /path/to/script.sh
Read following docs for more info:
How do I add jobs to cron under Linux or UNIX oses
SSH Public key based authentication - How-to?
How do I sync data between two Load balanced Linux/UNIX servers?
if you have more question just reply back and we will be glad to assist you