[conspire] rsync[-like], but for data on target device files?
Michael Paoli
Michael.Paoli at cal.berkeley.edu
Fri May 24 07:52:42 PDT 2019
Here's a question I've not (yet) found a (nice, simple[ish])
answer to.
So, rsync, (mostly) fine 'n wonderful and all that,
but what I'm looking for is quite similar, but will work
on the data of device files.
e.g. let's say I've got two files, call 'em A and B.
A is source, B target.
A might be an ordinary file, or a device file (of non-zero
fixed length).
B is a seekable device file.
The data on the two may already be fairly similar or maybe even
totally matched, but in any case, I want to match their data
up, and I don't want to do unnecessary writes to B, where the data
already matches that on A (at least down to "block") level.
Bonus points if:
o I can also set the block write size for A.
o it can be done across network
o it's a Debian package (or suitable option(s) to rsync thereof)
o it's in Debian stable
At least last I checked (maybe it's in a newer version I've not
yet examined?) I've seen no such options for rsync that will let
it do that. Essentially, what I've seen thus far, if source is
file or device, it will want to make B as same - file or device,
respectively, and replacing what's already there if it doesn't
match, and in the case of device file, just the file itself
(perms, ownerships, major & minor #s), not its data.
I've also searched for utilities that might do what I want
(maybe I didn't come up with the right combination of search
terms?) - but haven't yet found suitable utility/tool.
Anyway, curious if anyone knows of such a tool ... or even
(perhaps newfangled) option(s) to rsync that will allow it to
do that.
And, as one might guess, typical scenario is where target is some
variety of flash, and I'd rather not do writes to it more than
needed when I'm trying to match its data to an updated source.
Also considered ... losetup - if there were a way for it to effectively
to the reverse - present a seekable fixed length device file as
an ordinary file - a capability like that (or from some other utility),
that + rsync's option(s) to change the file in-place would also
suffice or mostly suffice to do the needed (rsync just wouldn't be able
to change the length of B - even if it tried, as A may be smaller
than B - I don't much care about bytes on B beyond size/length of A ...
though having option to sync that to nulls or such, as if A were
null padded to length of B, would be handy).
I've certainly also considered writing such a utility ... but seems
likely someone(s) else has already solved the problem with some
program/utility.
More information about the conspire
mailing list