[英]Connect / Sync a folder to another folder with a correct path
I have 2 Frameworks on my Virtual Server, both have a plugins folder and Framework A has some plugins which also need to be used in Framework B .我的虚拟服务器上有 2 个框架,都有一个插件文件夹,框架 A有一些插件也需要在框架 B中使用。
I need a connection from Framework B plugin folder to Framework A plugin folder .我需要从Framework B 插件文件夹到Framework A 插件文件夹的连接。 But it has to still work correctly if for example a file in Framework B uses the path to it's own plugins folder it should not result in an error because it's actually empty.
但是如果例如框架 B 中的文件使用它自己的插件文件夹的路径,它仍然必须正常工作,它不应该导致错误,因为它实际上是空的。
Do I need symlink, rsync or something else?我需要符号链接、rsync 还是其他东西?
/html/framework_a/plugins/... /html/framework_a/plugins/...
/html/framework_b/plugins/ /html/framework_b/plugins/
Ok based on your comment, Framework B must have all the files from Framedwork A, and nothing more.好的,根据您的评论,框架 B 必须具有框架 A 中的所有文件,仅此而已。 Then the solution is quite simple.
那么解决方案就很简单了。 You only have to link the entire directory.
您只需链接整个目录。
Therefore:所以:
$ cd /html/framework_b
$ mv plugins plugins-backup
$ ln -s /html/framework_a/plugins ./plugins
This will create a softlink, so if you do cd /html/framework_b/plugins
you will see the same files as in /html/framework_a/plugins
.这将创建一个软链接,因此如果您执行
cd /html/framework_b/plugins
您将看到与/html/framework_a/plugins
中相同的文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.