問(wèn)題描述
我可以使用基于 inotify
內(nèi)核子系統(tǒng)的解決方案來(lái)查看本地目錄.還有一些 Python 項(xiàng)目也在 inotify 之上運(yùn)行,例如 pyinotify、PyInotify, fsmonitor 和 看門狗.
I am able to watch local directories using inotify
kernel subsystem based solutions. There are some python projects too which are working on top of inotify like pyinotify, PyInotify, fsmonitor and watchdog.
我已經(jīng)使用 curlftpfs 在本地目錄中安裝了遠(yuǎn)程 ftp 服務(wù)器,所以現(xiàn)在所有同步都很容易.但 inotify 無(wú)法查看本地目錄等網(wǎng)絡(luò)掛載點(diǎn).
I have mounted remote ftp server in local directory using curlftpfs so all syncing is easy now. But inotify is not able to watch network mounted points like local directories.
我想跟蹤是否有新文件添加到 ftp 服務(wù)器.我怎樣才能像使用基于 inotify 的解決方案的本地目錄一樣實(shí)現(xiàn).
I want to track if there is new files added to ftp server. How can I achieve like I do for local directory using inotify based solution.
推薦答案
它幾乎無(wú)法工作.FTP 協(xié)議沒(méi)有 API 來(lái)通知客戶端有關(guān)更改.curlftpfs 必須不斷地輪詢遠(yuǎn)程文件夾以提供通知給 inotify 或其他類似工具.它幾乎沒(méi)有這樣做.
It can hardly work. The FTP protocol has no API to notify a client about the changes. The curlftpfs would have to continually poll the remote folder to provide the notification for inotify or other similar tool. It hardly does that.
您必須自己輪詢 FTP 文件夾.
You have to poll the FTP folder yourself.
參見(jiàn)例如 監(jiān)控遠(yuǎn)程 FTP 目錄.
這篇關(guān)于如何使用 Python 監(jiān)視和監(jiān)視新創(chuàng)建的文件的 ftp 掛載點(diǎn)的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!