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

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

问题描述

我能够使用基于 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挂载点是否有新创建的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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