I have two separate physical servers PRIMARY and SECONDARY connected with a ethernet switch of 100 mbps and i want to rsync files from my PRIMARY /home to SECONDARY /home and now after working for two hours in my SECONDARY server i have created some data in /home and so i want again the rsync to transfer the new data back to PRIMARY server. I think rsync handles the original data and new data automatically by itself.
1.so my question is how do i use rsync to transfer my PRIMARY /home data to SECONDARY /home ?
2.And also how do i again use rync on my SECONDARY server to transfer my updated /home to PRIMARY /home (which has the old data).
I also want this to be automated so how do i write a bash script for this process. Help will be appreciated.