Hi,
given n directories D1..Dn with arbitrary content. I would like a function that takes these source directories and copies their contents to a destination directory Dd such, that Dd is the union of all files and the fs structure of D1..Dn.
D1 - Folder1 - file1 - file2 - Folder2 - file4 D2 - Folder1 - file3 - file5 - Folder3 - file7 => Dd - Folder1 - file1 - file2 - file3 - file5 - Folder2 - file4 - Folder3 - file7
Right now, I can assume, that the sets of D1..Dn are mutually exclusive, but of course a hook on how to behave on clashes (and what type of clash .. name/diff) would not hurt.
Does such a thing already exist? I know about UnionFS, but rather than this transparent solution I would prefer a CLI-based batch processing tool, because these merging operations are one-shot only.
Update:
Maybe I should start to have LESS Perl on my mind... ;-)
> cp -a D[12]/* Dd/
Does the trick. Ok, it's not that portable, it's not perl, but for the moment...
Bye
PetaMem All Perl: MT, NLP, NLU
In reply to Unification of Directories (their contents) by PetaMem
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |