![](/img/trans.png)
[英]How to watch a Directory in HDFS for incoming Files using Python? (Python Script is executed by Docker Container; No Cronjob in HDFS)
[英]How to watch an hdfs directory and copy the latest file that arrives in hdfs to local?
我想在bash/python
编写一个脚本,以便该脚本复制到达hdfs
目录的最新文件。我知道我可以在本地使用inotify
,但是如何在hdfs?
实现它hdfs?
能否请您分享示例代码。 当我在谷歌搜索时,它给了我很长的代码。是否有比inotify
更简单的方法(如果它太复杂)
雅致的骇客:
使用FUSE挂接hdfs,然后定期使用find <mountpoint> -cmin n
获取最近n分钟内创建的文件列表。
然后使用find <mountpoint> -anewer
对它们进行排序。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.