简体   繁体   English

如何使用 Camel 自动执行将文件从一个目录复制到另一个目录的任务

[英]How to automate the task of copying files from one directory to another using Camel

I am new to Camel.我是骆驼的新手。 I tried a simple example of creating a route to copy files from one directory to another.我尝试了一个简单的示例来创建将文件从一个目录复制到另一个目录的路径。 I am using simple from and.to methods to do the same.我正在使用简单的 from and.to 方法来做同样的事情。

           from("file:input?noop=true")
               .to("file:output");

But for copying any new file that has been added to the input directory I need to run the code again.但是要复制已添加到输入目录的任何新文件,我需要再次运行代码。 I know that this task can be automated but I am confused with so many options.我知道这项任务可以自动化,但我对这么多选项感到困惑。 Can anyone suggest different ways to automate this task?任何人都可以提出不同的方法来自动化这项任务吗? Thanks谢谢

Camel polls the files automatically every 0.5 seconds. Camel 每 0.5 秒自动轮询一次文件。 If you want to poll every 5 minutes, you can add a delay option.如果要每 5 分钟轮询一次,可以添加延迟选项。 Something like this file:input?noop=true&delay=30000"像这样的file:input?noop=true&delay=30000"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将 .docx 文件从一个目录复制到另一个目录 - Copying .docx Files From One Directory to Another 在Java中将文件从一个目录复制到另一个目录 - Copying files from one directory to another in Java 使用JAVA从HDFS中的一个目录复制到HDFS中的另一个目录 - Copying from one directory in HDFS to another directory in HDFS using JAVA 在Java中将文件从一个目录复制到另一个目录会引发NoSuchFileException - Copying files from one directory to another in java throws NoSuchFileException 将目录和文件从一台Windows服务器复制到另一台 - Copying directory and files from one windows server to another 如何使用 apache 骆驼从目录中删除文件 - How to delete files from a directory using apache camel 使用Java将文件从一个目录移动到另一个目录 - Moving files from one directory to another, using Java 如何自动将文件从一个服务器位置复制到另一个位置并从源位置移动? - How to automate copy files from one server location to another and move from the source location? 将目录中的所有文件复制到另一个目录不起作用 - copying all files in a directory to another directory is not working Ant:将目录从一个Windows系统复制到另一个 - Ant: copying a directory from one windows system to another
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM