How old is the most recent file in a folder?

I purchased this Automise product in hopes that it can create a script that tells me how old the most recent file in a specific folder is.  What I need to do is email a notice if the most recent file in an archive folder is greater than 24 hours old.  This tells me that some process has failed me.

 

I want to acheive the same scenario as above with the number of files in a folder so that I am emailed if the number of files exceeds X amount.  This tells me that a process has failed and is not processing the delivered files.

 

Can anyone help me out and guide me how to get this done?

 

Thank you in advance.

-Ajay

 

 

Hi Ajay,


I've attached an example project which finds the files which are older then 24 hours. You'll just need to change the 'BaseDirectory' variable to point to the files you wish to check.


Regards,
Paul.

FileDateExample.atz3 (3.329 KB)

Hi Paul,

 

I just wanted to thank you for the quick response.  I am going to look into that project right now but wanted to thank you first.

 

If this works this will really benefit the organization I work for in numerous ways.

 

-Ajay

Hi Paul,

 

Can you please tell me about how you use the  " IF[%FileDateIsOlder%] = [true] " command in your project.  I am not sure where that variable comes from or how it is used here?

 

-Ajay

Hi Ajay,

The FileDateIsOlder variable is defined as a FinalBuilder project variable and is set in the ‘OnGetDate’ script event of the ‘Get Date’ action. To view the script event, select the action and then select the ‘OnGetDate’ tab within the ‘Script Editor’ tab (in the bottom pane).

Regards,
Paul.