![]() |
![]() |
We are currently migrating this forum over to our HelpSystems domain. Please post all new threads in our new HelpSystems Community Portal. |
![]() |
|
![]() |
AutoMate Discussion | ![]() |
help :
faq :
home
|
||
Latest News:
|
latest topics : statistics |
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 |
![]() |
![]()
|
![]() |
||||||||||
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.
|
||||||||||
|
||||||||||
![]() |
||||||||||
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.
------------------------- ![]() Ricardo Castaneda | Principal Support Analyst AutoMate | Division of HelpSystems HelpSystems, LLC | T: +1.213.738.1700 |
||||||||||
|
||||||||||
![]() |
||||||||||
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.
|
||||||||||
|
||||||||||
![]() |
||||||||||
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%
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 |
||||||||||
|
||||||||||
![]() |
||||||||||
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?
|
||||||||||
|
||||||||||
![]() |
||||||||||
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.
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 |
||||||||||
|
AutoMate Discussion
» AUTOMATE » AutoMate 7
»
Check Folder Activity
|
![]() |
FuseTalk Enterprise Edition v4.0 - © 1999-2021 FuseTalk Inc. All rights reserved.