0

Is it possible to use symbolic links or some other method, i.e. a 'virtual directory' or mount, by which the following is achieved, and persistent?

Directory tree A, original

root dir 
|
 +-- dir 1
 |  |  
 |  +-- dir 1.1

Directory tree B, symlinked/virtualised to remove one layer in the tree

root dir 
|
 +-- dir 1.1

I know it can be done as a one time operation by generating symbolic links, but I'm wondering if there's a way to make it persistent, so that if I add a folder 1.2 in directory tree A, it will always show up in the root of directory tree B?

  • 1
    Hello inthevidual, could you [explain a little more](https://unix.stackexchange.com/posts/582611/edit) (in your question) what problem you're trying to solve here. There might be solutions using a different approach. – roaima Apr 26 '20 at 12:11
  • Please also specify what extent of persistence you desire. For instance, persistent across shifts of file systems, etc? – ingli Apr 26 '20 at 12:53

1 Answers1

0

You can use rsync with some script that is ran when new item is created in the first directory. something like rsync --avu delete /dirA /dirB This is helpful: How to sync folders For the script you can use inotify to monitor the create/delete actions in the directory

Angel
  • 310
  • 2
  • 10