I want to traverse a filesystem and copy parts of it to another filesystem by creating symlinks instead of copying anything.
rsync
would be ideal if it had something like a --local-copy-via-symlink
option, because rsync
's inclusion/exclusion filters would be the best way to specify what I want to copy.
I know I can do this with a script, but is there a clever command that does this already?
Simply put, there is nothing "clever" to do.
EDIT
Instead of creating symlinks, Linux has the concept of a "bind" mount. Since Linux 2.4.0 it is possible to remount part of the file hierarchy some where else. The call is:
or fstab entry is:
After this call the same contents is accessible in two places. This preserves all existing permissions. but you don't have symbolic links either.