如何使用 Python 监视和监视新创建的文件的 ftp 挂载点 [英] How to watch and and monitor ftp mounted point for new created files using Python

查看:43
本文介绍了如何使用 Python 监视和监视新创建的文件的 ftp 挂载点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以使用基于 inotify 内核子系统的解决方案来查看本地目录.还有一些 Python 项目也在 inotify 之上运行,例如 pyinotifyPyInotify, 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 挂载点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆