访问两个日期之间生成的文件 [英] Accessing the files generated between two dates

查看:91
本文介绍了访问两个日期之间生成的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Azure Data Factory V2将数据从本地源复制到Azure Sink.在源端,每天都会创建一个新文件夹,并在该文件夹下创建多个文件.我的要求是仅在两个日期之间复制文件夹 而不是一次复制所有内容.例如,自最近十天以来仅检索文件夹.我能够复制所有内容一次,但无法在两个日期之间复制数据.

I am using Azure Data Factory V2 for copying data from an on-premise source to Azure Sink. In the source side, a new folder is created each day and multiple files are created under that folder. My requirement is to copy the folders between two dates only instead of copying everything at once. For instance, retrieving only the folder since last ten days. I am able to copy everything once but couldn't copy the data between two dates.

正在寻求帮助/建议.

谢谢.

推荐答案

要复制在两个日期之间创建的文件夹,您可以尝试以下步骤:

To copy folders created between two dates, you could try the below steps:

1.使用 获取元数据活动以获取所有文件/文件夹,并设置

1. Use Get metadata activity to fetch all files/folders, set the childItems in the field list

2.创建一个 对于每个活动,并传递获取元数据"活动的输出 @activity('Get Metadata1').output.childItems

2. Create a For each activity and Pass the output of the Get metadata activity "@activity('Get Metadata1').output.childItems" to the For each activity

3.在对于每个活动"中,创建另一个获取元数据"活动以获取" 每个文件夹的时间,然后涉及 如果是活动,请检查" lastModified

3. In For each activity, create another Get Metadata activity to fetch the "lastModified" time of each folder, then involve an If activity to check whether the "lastModified" of a folder is in the two dates you need, and create a Copy activity as the If true activity, thus only copying the folders created between two dates.

此外,如果您需要定期运行上述复制任务,请使用 安排触发器.谢谢.

Also, if you need to run the above copy task periodically, please use the schedule trigger. Thanks.


这篇关于访问两个日期之间生成的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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