如何将子文件夹内容挂载到父文件夹?

发布于 2024-10-03 14:19:25 字数 261 浏览 1 评论 0原文

我的文件夹结构如下:

/files
/files/upload

我需要将 /files/upload 挂载到 /files。

当用户上传文件到

/files/upload
it should auto copy(sync/mount) uploaded file to base folder:
/files
.

使用linux mount命令可以实现吗?

谢谢。

I have folder structure as below:

/files
/files/upload

I need to mount /files/upload to /files.

When user uploads files to

/files/upload

it should auto copy(sync/mount) uploaded file to base folder:

/files

.

Is it achievable using linux mount command ?

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

青衫负雪 2024-10-10 14:19:25

不,那将是相当递归的。

但是,您可以只需要一个单独的进程/守护程序来手动移动/复制文件。

Linux 中有一种名为“fnotify”的机制,可以让守护进程注册文件系统事件。即,每当有人将文件添加到 /file/upload 时,它都会告诉守护进程 - 允许您启动复制/移动。

但在采用某种方法之前,我很想听听更多关于为什么要这样做的信息。

No. That would be pretty recursive.

You can however just have a separate process/daemon that moves/copies the files manually.

There is a mechanism in Linux called "fnotify" that would let a daemon register for filesystem events. i.e. it would tell the daemon whenever someone added a file into /file/upload - allowing you to initiate the copy/move.

But I'd be interesting in hearing more about why you are doing this before committing to a method.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文