Question

I'd like to synchronize a files structure to another, but transformed one, eg:

filesStructureA/ --[transformation(T)]--> filesStructureB/

Is it possible doing this with rsync? I saw rsync accept a list of files as input (--files-from), but don't really know how to apply the transformation T for each of one...

In other words, is it possible with rsync to rename files on the fly ?

Thank you.

for an example, from src/ to dst/, suppress every bar/ occurences in the destination path, eg:

src/foo/hi.txt
src/foo/bar/hey.txt
src/foo/bar/bar/lorem/bar/hoy.txt

sed 's/bar\///'          <- [Transformation function]

dst/foo/hi.txt
dst/foo/hey.txt
dst/foo/lorem/hoy.txt

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top