Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

2 Answers 2

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

Your Answer

 
discard

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.