如何使用 Python 监视和监视新创建的文件的 ftp 挂载点

2022-11-02Python开发问题
5

本文介绍了如何使用 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 挂载点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

在xarray中按单个维度的多个坐标分组
groupby multiple coords along a single dimension in xarray(在xarray中按单个维度的多个坐标分组)...
2024-08-22 Python开发问题
15

Pandas中的GROUP BY AND SUM不丢失列
Group by and Sum in Pandas without losing columns(Pandas中的GROUP BY AND SUM不丢失列)...
2024-08-22 Python开发问题
17

pandas 有从特定日期开始的按月分组的方式吗?
Is there a way of group by month in Pandas starting at specific day number?( pandas 有从特定日期开始的按月分组的方式吗?)...
2024-08-22 Python开发问题
10

GROUP BY+新列+基于条件的前一行抓取值
Group by + New Column + Grab value former row based on conditionals(GROUP BY+新列+基于条件的前一行抓取值)...
2024-08-22 Python开发问题
18

PANDA中的Groupby算法和插值算法
Groupby and interpolate in Pandas(PANDA中的Groupby算法和插值算法)...
2024-08-22 Python开发问题
11

PANAS-基于列对行进行分组,并将NaN替换为非空值
Pandas - Group Rows based on a column and replace NaN with non-null values(PANAS-基于列对行进行分组,并将NaN替换为非空值)...
2024-08-22 Python开发问题
10