I'm attempting to symlink files to a mirrored directory tree. Both directories (source and desired destination of symlinks) are on separate mountpoints inside a FreeBSD jail.
Source directory: /mnt/tank/media/storage/vids/foo/
. foo has several levels of nested hierarchy below from which files need to be symlinked from.
Desired destination directory /mnt/tank/media/videos/foo/
, under which the proper directory structure has been created using the following command, executed from the source directory foo:
find . -type d | cpio -dmp -R user:group /mnt/tank/media/video/foo
This command did what I need, which was create the mirrored directory structure, sans files. I now need to symlink all the files from source foo into destination foo, in the proper directory structure.
I've tried various find commands with xargs and -exec, but the issue I have is that I need the destination argument in the ln -s source destination
command to be different than what the find command will return.
I'm sure there is some relative path usage of find that I can use or something, I just am not knowledgeable enough to know the right way to do this.
Thanks!