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

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

We use a third party newsletter system which updates frequently, usually around 100 files. Each time all the developers release is the whole application again with a changelog but there's usually too many files listed for it to be useful. The system - once online - generates a lot of files (caches etc) so i dont want to download the remote files to do a local diff each time either. What i want to do is upload the zip of all the newly released files and run a Diff (or similar) and copy over from new_files -> existing_files just the updated files and ignore the files in existing that aren't in new. Whats the best way to do this?

I know this can be achieved to an extent using copy but its my understanding that this is largely based on last edited date but i'm more interested in actual file differences

This is on CentOS 5 and i have shell access


share|improve this question
You did not mention which operating system you are working with. Also do you have command line access to the remote system if it is *nix based? Also, if the new and old files are the same, what is the harm of overwriting all of the files? – Dave Drager Jun 19 '09 at 14:31
yep, should have said this is on CentOS and I have shell access – seengee Jun 19 '09 at 14:38
up vote 4 down vote accepted

With linux, ssh in and use rsync

this will help

share|improve this answer
yeah, as soon as i posted the question i started to think about why i'm not just doing this with rsync. is there any good reason why i shouldnt? a better option ? – seengee Jun 19 '09 at 14:39
This was going to be my answer as well - Use the -c (--checksum) which creates md5 hashes I believe, so that you are not using the file change date. – Dave Drager Jun 19 '09 at 14:45
SSH and rsync will give you security and a solid repeatable solution. I think it's the way to go. ;-) – MathewC Jun 19 '09 at 14:47
yes, this definitely makes the most sense the more i think about it – seengee Jun 19 '09 at 14:51
Awesome ::cough click the check mark cough:: I'm glad this will work for you. ;-) – MathewC Jun 19 '09 at 15:08

rsync? rsync uses hashing to determine changes andthen syncs the diffs.

share|improve this answer
yes, that seems to be the best option. not sure what the best command would be to run so looking into this now, got this so far: rsync -c -av --stats --progress newfiles/ oldfiles/ – seengee Jun 19 '09 at 15:24

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.