Skip to content

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.
If you need a quicker response, please create a support ticket via the customer portal my.goanywhere.com or contact our support team by email at [email protected].
  • estepj01 Offline
  • Posts: 1
  • Joined: Thu Sep 14, 2017 1:30 pm

Exclude Files within the last hour

Post 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
  • Support_Jerrod Offline
  • Support Specialist
  • Posts: 11
  • Joined: Wed Dec 13, 2017 5:52 pm

Re: Exclude Files within the last hour

Post 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
Attachments
Files Older Than One Hour.xml
Example Project
(1001 Bytes) Downloaded 1201 times
Jerrod Foster
Support Analyst

e. [email protected]
p. 1.800.949.4696
w. HelpSystems.com
Post Reply