简体   繁体   English

使用正确的路径将文件夹连接/同步到另一个文件夹

[英]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.

相关问题 将文件夹从一个fedora 15服务器同步到另一个 - Sync folder from one fedora 15 server to another 流浪者共享文件夹不同步 - Vagrant shared folder without sync 将可执行文件移动到$ PATH中的另一个文件夹后,找不到可执行文件 - Cannot find a executable file after I move it to another folder in $PATH IntelliJ无法同步目标文件夹中的更改 - IntelliJ fails to sync changes in the target folder 单向同步和跳过Linux中的特定文件夹 - One Way Sync and skip specific folder in Linux 如何将文件从一个文件夹复制到另一个文件夹 - How to copy a file from a folder to another folder 如何将Windows文件夹路径转换为linux文件夹路径 - how to translate windows folder path to linux folder path 我只需要将父文件夹下多个子文件夹中的符号链接复制到另一个文件夹中,维护符号链接中的相对路径信息 - I need to copy only symlinks from within multiple subfolders under a parent folder to another folder maintaining relative path information in symlinks 为什么nginx复制路径中的文件夹 - Why is nginx duplicating the folder in the path Codeigniter错误的系统文件夹路径 - Codeigniter bad system folder path
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM