Bob Friesenhahn wrote: > On Mon, 24 Nov 2008, BJ Quinn wrote: > > >> Here's an idea - I understand that I need rsync on both sides if I >> want to minimize network traffic. What if I don't care about that - >> the entire file can come over the network, but I specifically only >> want rsync to write the changed blocks to disk. Does rsync offer a >> mode like that? -- This message posted from opensolaris.org >> > > My understanding is that the way rsync works, if a file already > exists, then checksums are computed for ranges of the file, and the > data is only sent/updated if that range is determined to have changed. > While you can likely configure rsync to send the whole file, I think > that it does what you want by default. > > This is very easy for you to test for yourself. > > Bob > ====================================== > Bob Friesenhahn > [EMAIL PROTECTED], http://www.simplesystems.org/users/bfriesen/ > GraphicsMagick Maintainer, http://www.GraphicsMagick.org/ > > _______________________________________________ > zfs-discuss mailing list > zfs-discuss@opensolaris.org > http://mail.opensolaris.org/mailman/listinfo/zfs-discuss >
This is indeed the default mode for rsync (deltas only). The '-W' option forces copy of the entire file, rather than just the changes. I _believe_ the standard checksum block size is 4kb, but I'm not really sure. (it's buried in the documentation somewhere, and it customizable via the -B option) One note here for ZFS users: On ZFS (or any other COW filesystem), rsync unfortunately does NOT do the "Right Thing" when syncing an existing file. From ZFS's standpoint, the most efficient way would be merely to rewrite the changed blocks, thus allowing COW and snapshots to make a fully efficient storage of the changed file. Unfortunately, rsync instead writes the ENTIRE file to an temp file ( .blahtmpfoosomethingorother ) in the same directory as the changed file, writes the changed blocks in that copy, then unlinks the original file and changes the name to the temp file to the original one. This results in about worst-case space usage. I have this problem with storing backups of mbox files (don't ask) - I have large files which change frequently, but less than 10% of the file actually changes daily. Due to the way rsync works, ZFS snapshots don't help me on replicated data, so I end up having to restore the entire file every time. I _really_ wish rsync had an option to "copy in place" or something like that, where the updates are made directly to the file, rather than a temp copy. -- Erik Trimble Java System Support Mailstop: usca22-123 Phone: x17195 Santa Clara, CA _______________________________________________ zfs-discuss mailing list zfs-discuss@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/zfs-discuss