如何将子文件夹内容挂载到父文件夹?
我的文件夹结构如下:
/files /files/upload
我需要将 /files/upload 挂载到 /files。
当用户上传文件到
/files/uploadit 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,那将是相当递归的。
但是,您可以只需要一个单独的进程/守护程序来手动移动/复制文件。
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.