Page 1 of 1

Exclude Files within the last hour

Posted: Fri Dec 01, 2017 11:18 am
by estepj01
I want to monitor a folder and make sure a file is deleted (picked up) within an hour and email me if it is not.

In A project I tried:
Connect to Remote Server, use "List Files""
see if any file is over an hour old based on # Files found and use a "Date" filter to "exclude" files using:
From Date:${AdjustDateTime(CurrentTimestamp('yyyy-MM-dd HH:mm:ss'), 'yyyy-MM-dd HH:mm:ss', 'hours', -1)}
To Date: ${AdjustDateTime(CurrentTimestamp('yyyy-MM-dd HH:mm:ss'), 'yyyy-MM-dd HH:mm:ss', 'hours', -0)}
Tried using Variables with format 'yyyy-MM-dd HH:mm:ss'
tried hard coded dates such as: 2017-12-01 08:54:21

Nothing seems to work For excluding files for last hour, the Exclude "Date" filter just seems to work for entire days/dates

Anybody else have luck doing something like this.
Thanks,
Joe

Re: Exclude Files within the last hour

Posted: Fri Dec 15, 2017 11:24 am
by Support_Jerrod
Hello Joe,

In this situation, you will only need to use one timestamp task and add a format. This will allow you to set the “Hour” field to -1. The value of the timestamp variable will now be the current date/time that the project is executed minus one hour. Now, when defining the date filter for the file set, you will want to use your Timestamp variable in the To Date field, leave the From Date field blank, and set the Date Filter of type Include. Leaving the From Date blank tells the filter that you want all files that have been modified before the specified To Date. This will ensure that your filelist is created with all files that are older than one hour at the time the project is executed. I have attached a copy of the modified project using this logic.

Thank you,

Jerrod Foster
Product Specialist