Exclude Files within the last hour

Post any question you may have in regards to GoAnywhere MFT and let our talented support staff and other users assist you.
2 posts Page 1 of 1

estepj01

Posts: 1
Joined: Thu Sep 14, 2017 1:30 pm

Post by estepj01 » Fri Dec 01, 2017 11:18 am
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

Support_Jerrod

Support Specialist
Posts: 5
Joined: Wed Dec 13, 2017 5:52 pm

Post by Support_Jerrod » Fri Dec 15, 2017 11:24 am
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
Attachments
Files Older Than One Hour.xml
Example Project
(1001 Bytes) Downloaded 233 times
2 posts Page 1 of 1