Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

1 Answer 1

up vote 3 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 at 15:56

Your Answer


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