CSights
2007-Apr-18 23:44 UTC
why does --size-only not detect change only is size (but also time)?
Hi, I'm wondering why when I use --size-only on the same file, except the modification time, rsync transfers the modification time? I was under the impression that --size-only caused rsync to transfer files based upon differences in the size of the file. For example: #cp Untitled.pdf Untitled-2.pdf #touch Untitled.pdf #rsync -ani --size-only Untitled.pdf Untitled-2.pdf .f..t...... Untitled.pdf #ls -al --block-size=1 Untitled* -rw------- 1 csights csights 20696 2007-04-18 19:00 Untitled-2.pdf -rw------- 1 csights csights 20696 2007-04-18 19:08 Untitled.pdf It seems to me as though this file should not be transfered because the sizes are the same. Thanks, C.
Wayne Davison
2007-Apr-18 23:55 UTC
why does --size-only not detect change only is size (but also time)?
On Wed, Apr 18, 2007 at 07:37:44PM -0400, CSights wrote:> #rsync -ani --size-only Untitled.pdf Untitled-2.pdf > .f..t...... Untitled.pdfThe file was not transferred (since there was not '<' or '>' in the first character). The time was changed due to the --times option being implied by -a. ..wayne..
Matt McCutchen
2007-Apr-19 00:01 UTC
why does --size-only not detect change only is size (but also time)?
On 4/18/07, CSights <csights@fastmail.fm> wrote:> I'm wondering why when I use --size-only on the same file, except the > modification time, rsync transfers the modification time? > I was under the impression that --size-only caused rsync to transfer files > based upon differences in the size of the file.[...]> #rsync -ani --size-only Untitled.pdf Untitled-2.pdf > .f..t...... Untitled.pdf[...]> It seems to me as though this file should not be transfered because the sizes > are the same.The first character of the itemize line is a period, which means that rsync decided that the file's data was the same on both sides and thus didn't transfer the file per se. (If rsync did transfer it, the character would be a < or >.) All rsync did was copy the mtime, which you asked it to do by passing -a, which includes --times. If you don't want to copy mtimes at all, add --no-times somewhere after the -a on the command line. Then transferred files will have their mtimes set to the current time by virtue of rsync modifying their data, while other files' mtimes will be left alone. I don't think there's a way to copy mtimes on transferred files but not already up-to-date files. Matt
Reasonably Related Threads
- [Bug 36422] New: unable to hibernate with nouveau and NV11 [bisected]
- XP not obeying Samba file perms
- OS X Clients Can't Create Sub-Directories
- How to create a chromosome location map by locus ID
- Can't create any VPS using KVM template due to the error with libguestfs