How to watch and and monitor ftp mounted point for new created files using Python

白昼怎懂夜的黑 提交于 2021-02-16 15:23:28

问题


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.

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.

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.


回答1:


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.

You have to poll the FTP folder yourself.

See for example Monitor remote FTP directory.



来源:https://stackoverflow.com/questions/47530635/how-to-watch-and-and-monitor-ftp-mounted-point-for-new-created-files-using-pytho

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!