Network Automation Software We are currently migrating this forum
over to our HelpSystems domain. Please
post all new threads in our new
HelpSystems Community Portal.
Post to the HelpSystems Forum
You are not currently logged on. You must be logged on in order to post. Log on
Or Create a new account
AutoMate Discussion
Decrease font size
Increase font size
Topic Title: Check Folder Activity
Topic Summary: How to check folder activity
Created On: 11/20/2015 11:25 AM
Status: Read Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
View similar topics View similar topics
View topic in raw text format. Print this topic.
 11/20/2015 11:25 AM
User is offline View Users Profile Print this message

Author Icon
WayneOrndorff
Student (5-19 posts)

Posts: 16
Joined: 10/21/2014

I'm hoping someone may be able to assist.  I need a way to check a folder to see if there has been activity in the folder.  Here's the scenario.  I have a folder that contains many subfolders.  Daily anywhere from 5 to 80 new subfolders will be created in the main folder.  There are no files in the main folder, just the subfolders.  The subfolders will get files added regularly.  I'd like to have a job that checks the main folder to determine if there has been activity within the main folder or any subfolder within x number of minutes.  If not, I need it to send an email notification.

 

Thanks.



 Category Survey
AutoMate 7 version: 7.1.3
Windows version: Windows 2008 R2
 11/20/2015 02:32 PM
User is offline View Users Profile Print this message

Author Icon
Ricardo Castaneda
HelpSystems

Posts: 3424
Joined: 01/11/2008

Hi Wayne,

Have you tried the "Get Information" with the General set to Folder? The dataset will come up with the %dstest.LastAccessTime% Last Access Time.

Let us know if that works for you.


 Category Survey


-------------------------

Ricardo Castaneda | Principal Support Analyst
AutoMate | Division of HelpSystems
HelpSystems, LLC | T: +1.213.738.1700
 12/01/2015 09:23 AM
User is offline View Users Profile Print this message

Author Icon
WayneOrndorff
Student (5-19 posts)

Posts: 16
Joined: 10/21/2014

I'm trying what you suggested.  The only option close to what I see you advising is the task entitled "Get File(s) Information".  On the General tab it won't let me put the folder in questions.  It's expecting a file.  I'm not sure I"m using the right function or if I'm misunderstanding what you are recommending.



 Category Survey
AutoMate 7 version: 7.1.3
Windows version: Windows 2008 R2
 12/02/2015 09:06 AM
User is offline View Users Profile Print this message

Author Icon
Ricardo Castaneda
HelpSystems

Posts: 3424
Joined: 01/11/2008

Hi Wayne,

Please try running the following. I would suggest you create a test folder and modify the action to look at that folder. The dataset you will be looking at it %ds.LastAccessTime%


 Category Survey



Task Steps: (Right click, Select All, Copy to copy to the clipboard. Steps can then be pasted into the AutoMate Task Builder)


-------------------------

Ricardo Castaneda | Principal Support Analyst
AutoMate | Division of HelpSystems
HelpSystems, LLC | T: +1.213.738.1700
 12/02/2015 10:41 AM
User is offline View Users Profile Print this message

Author Icon
WayneOrndorff
Student (5-19 posts)

Posts: 16
Joined: 10/21/2014

Ricardo,

 

Your suggestion will not work in the 7.1.3 version of Automate we are using.  When I paste your suggestion to modify and test with my own folder, it only shows up as NA.  If I put a "Get File(s) Information action into the script, it shows as below:

<AMGETFILEINFO FILE="C:\Support" RESULTDATASET="ds" />

Can this be modified to check whether a folder has had activity or does it only work with files?



 Category Survey
AutoMate 7 version: 7.1.3
Windows version: Windows 2008 R2
 12/03/2015 02:00 PM
User is offline View Users Profile Print this message

Author Icon
Leonard Amabile
HelpSystems

Posts: 5454
Joined: 05/15/2007

Hi Wayne,

Unfortunately v7 only supports files whereas v8 and higher supports files and folders. However, there are alternatives. Please see the attached code that uses PowerShell.

powershell.exe "Get-ChildItem -Recurse c:\test | Where {$_.PSIsContainer -eq 'Directory'} | Where{$_.LastWriteTime -gt (Get-Date).AddMinutes(-50)} | Select-Object FullName, LastWriteTime | Out-File c:\test\output.txt"

In the above PowerShell command, we are recursively searching for folders that have a last write time of within the last 50 minutes. You can update the option to whatever minute threshold you require. Also, you may adjust the parent folder specification as well as the output folder and file. You can then read the output file to get the list of folders that have a last write time of within the specified time frame.

 Category Survey
AutoMate 7 version:
Windows version:



Task Steps: (Right click, Select All, Copy to copy to the clipboard. Steps can then be pasted into the AutoMate Task Builder)


-------------------------

Leonard Amabile | Director, Cross Platform Support
AutoMate | InterMapper | Skybot | Divisions of HelpSystems
T: +1.213.738.1700 | F: +1.213.738.7665
Statistics
18258 users are registered to the AutoMate Discussion forum.
There are currently 0 users logged in.
The most users ever online was 5551 on 01/08/2018 at 11:11 AM.
There are currently 1514 guests browsing this forum, which makes a total of 1514 users using this forum.

FuseTalk Enterprise Edition v4.0 - © 1999-2020 FuseTalk Inc. All rights reserved.

Sitemap Network Automation Software Blog