Search Specific Folder Within Tree for Stale Files

How to search specific folders within Tree for stale files

In my example, I expanded upon a task I wrote to search a root folder on a remote server for files that were "stale". For my purposes, this condition was met when the files were 2 minutes old or older.

In production, I send an email and use the log file as the body of the message.

I recently had a need to search a specific folder within an entire directory tree. That folder name was "PENDING" and could potentially reside at ANY level within the tree.

This task is a reflection of that changed need. To reduce the time it takes to search this large directory structure, I am excluding directories with the name "history". In this example, the results are only logged to a log file.

In testing, this worked both locally and while searching on remote locations using a UNC path.

Task Category:

Functions (Basic)