Super User is a question and answer site for computer enthusiasts and power users. 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 have a simple scenario where I need to generate releases for some java based software. What I've been doing manually is:

1- Build the software 2- Copy all that is needed to a "release dir" 3- Compress the file

Now I have added CI (jenkins) to create builds for me. Then I tried rsync to update a base install dir (which contains the last build). The problem with RSYNC is it uses timestamps. Since I just build a new version, all timestamps have changed. I there something I can do to compare the files in binary mode?

EDIT

This is what I did. For now, src1 and src2 are the same. The only difference is the timestamp as src2 is a copy of src1. Then, rsync copies all the files to dst. I was expecting dst to be empty.

rsync -av --progress --stats --compare-dest=../src1/ src2/ dst/

So I tried the following. I generated a copy of src1 with the same timestamp and when I execute the same command, dst is empty. Which led me to believe rsync uses timestamps.

share|improve this question

rsync effectively compares the files in binary mode, it only transmits contents if a difference in binary content is found.

As I understand it, the checks on modification time (and size) are used to select files for comparison.

rsync has a --size-only option

share|improve this answer
    
I edited a bit my post. I read that rsync compares the files, but I think timestamp difference is enough to send a fresh copy. I want to force a binary comparison. – code-gijoe Aug 13 '12 at 14:49
    
Maybe rsync doesn't do byte-range comparison for local copies? When you think about it, to checksum the files it has to read both fully. To do a copy it has to read one fully and write one fully. There may not be a lot to be gained? – RedGrittyBrick Aug 13 '12 at 15:56
up vote 1 down vote accepted

Need to use option, otherwise, the default is a quick timestamp and size comparison

--checksum

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .