Treearrange: a compliment to rsync

Aug 27, 2006 22:59

My quick hack of the evening is treearrange, which rearranges a directory tree based on a description of a directory tree, which the tool also generates ( Read more... )

tech, hack

Leave a comment

Comments 18

gaal August 28 2006, 06:55:34 UTC
Oh, excellent, I've been wanting something like this for music. I wonder though if this can't be made better by knowing more about tags. The problem is syncing files several ways, when sometimes the updates are to metadata. Unfortunately the filenames can sometimes change too, so there's no key for this!

Reply

evan August 28 2006, 07:03:43 UTC
I have exactly this problem! I guess you could fingerprint the files minus the tags -- the one part that doesn't change is the music data itself.

Reply

gaal August 28 2006, 07:24:10 UTC
But then how can resume work?

I start syncing by pulling a new file from remotehost to my localhost. Then the download is interrupted, and I resume it. What identifies the partial file on localhost?

Reply

gaal August 28 2006, 07:26:04 UTC
Hm, maybe the syncer should pre-tag all files with their own fingerprint and make sure that gets transmitted early?

Reply


goldfischegirl August 28 2006, 07:52:31 UTC
I just have to say, that is sure one homosexual icon.
Lovin' it.

Reply


jwz August 28 2006, 08:20:00 UTC
You know the file names are unique, so you don't need to hash: I do this kind of thing on the fly with a keyboard macro that generates "mv" commands...

Reply

iamo August 28 2006, 08:29:02 UTC
However, by using a fingerprint it's somewhat more flexible. It'll work even when the original structure of the two trees were not the same.

Reply

ciphergoth August 28 2006, 09:18:04 UTC
I would say that makes it less flexible, as well as somewhat slower.

I'd rather something that was the same "shape" as rsync (ie runs on both ends at once) that tries to move files around to make "rsync" work, based on a number of heuristics (file name, size, last modified date, first bytes, last bytes...) applied in order.

Reply

brad August 28 2006, 16:32:11 UTC
Yeah, that's what I wanted too, but I realized it was only a few minute problem if I did the minimal work first.

Later I can add an rsync-ish interface, maybe just ssh'ing to the remote host, running Perl, and piping the original script into it, so the other side doesn't even need treearrange.

Reply


unison yuval_kogman August 28 2006, 09:13:14 UTC
unison can do this, albeit not intelligently.

It doesn't have smart tracking of mv's for 3-way merging, but it does have the xferbycopying feature which will check if a remote file with the same checksum exists.

Reply

Re: unison edm August 28 2006, 21:35:48 UTC
Excellent. I was going to suggest that this feature should really be part of something like rsync (which already walks the directories, takes checksums, compares them, etc). Having a separate script is useful, but it'd be even nicer if it "just worked" in the face of running something like rsync (ie, copied/moved files that have moved, and uploaded any new ones).

Ewen

Reply

Re: unison awwaiid August 29 2006, 06:05:01 UTC
Yes, I adore unison... use it to sync my home directory between about six machines, many of them using ssh rsa keys to do it unattended. Work on a project on my machine here tonight, tomorrow I go in to work and it's there waiting.

Reply


lakeguy August 28 2006, 11:18:58 UTC
you could always just sort at work :P

Reply


Leave a comment

Up