rsync files from subfolders on source to root of a folder on destination

Matthias Schniedermeyer ms at citd.de
Mon Apr 23 05:07:08 MDT 2012


On 23.04.2012 16:50, James Robertson wrote:
> I wish to sync a bunch of flac files that reside in various subfolders
> to the root of a folder on a destination.
> 
> An example of the directory structure on the source is:

...

I think hard-links are the easiest solution.

mkdir hardlinks
find Music -type f -print0 | xargs -0 cp -al -t hardlinks
(You get a warning from cp about doubles, if any)

Then you can rsync the 'hardlinks'-directory as usual.

When you want to update you should just 'rm -rf hardlinks' then execute 
the find again. That way even deletions work as expected (Or just put it 
in a script).




Bis denn

-- 
Real Programmers consider "what you see is what you get" to be just as 
bad a concept in Text Editors as it is in women. No, the Real Programmer
wants a "you asked for it, you got it" text editor -- complicated, 
cryptic, powerful, unforgiving, dangerous.



More information about the rsync mailing list