問題描述
我可以使用基于 inotify
內核子系統的解決方案來查看本地目錄.還有一些 Python 項目也在 inotify 之上運行,例如 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.
我已經使用 curlftpfs 在本地目錄中安裝了遠程 ftp 服務器,所以現在所有同步都很容易.但 inotify 無法查看本地目錄等網絡掛載點.
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 服務器.我怎樣才能像使用基于 inotify 的解決方案的本地目錄一樣實現.
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.
推薦答案
它幾乎無法工作.FTP 協議沒有 API 來通知客戶端有關更改.curlftpfs 必須不斷地輪詢遠程文件夾以提供通知給 inotify 或其他類似工具.它幾乎沒有這樣做.
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.
參見例如 監控遠程 FTP 目錄.
這篇關于如何使用 Python 監視和監視新創建的文件的 ftp 掛載點的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!