Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

i use rsync -avh

I just want to know that if the file on destination already exists does the rsync overwrite the new file or not

share|improve this question
up vote 8 down vote accepted

If the file contents are the same, then no; it will merely fudge the metadata to match. If the file contents differ then the file will be overwritten; use --ignore-existing to change this behavior, or -u to use a different, sane behavior.

share|improve this answer
So it actually replaces the file, not update? If that file is hard-linked, the the other link is unaffected? – Mark Jul 31 '15 at 15:56

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.