Solved

Tools for monitoring files in a folder

Posted on 2014-01-19
10
214 Views
Last Modified: 2014-04-10
Hi,
I want to monitor a folder for files and alert if we dont get a file for some time.

Thanks,
Ravi
0
Comment
  • 5
  • 3
10 Comments
 
LVL 42

Expert Comment

by:Rob Jurd, EE MVE
ID: 39793386
Windows platform?
Will any of the files be overwritten? meaning the modified date of the file would need to be checked?
0
 
LVL 42

Accepted Solution

by:
Rob Jurd, EE MVE earned 133 total points
ID: 39793406
A simple script should do it that can be scheduled to run as often as you need to test.

this is vb script, assuming windows platform:

Set wshShell = CreateObject( "WScript.Shell" )
Set wshSystemEnv = wshShell.Environment( "SYSTEM" )

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder("C:\FSO")
Set colFiles = objFolder.Files

' Display the current value
If wshSystemEnv( "FileCount" ) = colFiles.Count Then
' Display an ALERT
Else
' Set the environment variable
wshSystemEnv( "FileCount" ) = colFiles.Count

End If

Open in new window

0
 
LVL 8

Assisted Solution

by:Surrano
Surrano earned 67 total points
ID: 39793525
Depending on the use case it may become quite complex.
Below is a unix (bash) shell solution that assumes
- a file modification timestamp is in accordance with its appearance in the directory.
- a changed file is considered "new"
- only regular files (not directories, FIFOs, symlinks, block devices, etc) are checked

#!/bin/bash

# seconds to sleep
SLEEP=60
# directory to monitor
DIR=~/incoming
# 
BASELINE="/var/run/incoming.baseline"

# establish baseline
touch "$BASELINE"

while true; do
  sleep $SLEEP
  touch "${BASELINE}.tmp"
  newfile=`find "$DIR" -type f -newer "$BASELINE" | head -1`
  mv "${BASELINE}.tmp" "$BASELINE"
  if [ "$newfile" = "" ]; then
    # do the alerting of your choice
  fi
done

Open in new window

0
 

Author Comment

by:Ravi Kiran Reddy Katkuri
ID: 39828558
Hi,

All the files will be over written if not processed by a job.

Thanks,
Ravi
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 42

Expert Comment

by:Rob Jurd, EE MVE
ID: 39852499
What platform are you running on?
0
 

Author Comment

by:Ravi Kiran Reddy Katkuri
ID: 39902486
Windows server  platform
0
 
LVL 42

Expert Comment

by:Rob Jurd, EE MVE
ID: 39904691
Did you try any of the scripts posted above?
0
 

Author Comment

by:Ravi Kiran Reddy Katkuri
ID: 39911137
I am not a expert in scripting. I am looking for tools with user interface and easy to use. It can be open source or commercial one.
0
 
LVL 42

Assisted Solution

by:Rob Jurd, EE MVE
Rob Jurd, EE MVE earned 133 total points
ID: 39911543
Sorry I haven't used any of the following ,but the first link is a review of the top 10 tools to monitor files.

http://www.raymond.cc/blog/3-portable-tools-monitor-files-folders-changes/

"Watch 4 folder" Comes up a lot and well recommended. There is a free Version but it will only monitor one folder. Claims to capture up to 12 or 13 events but to not overload your system l would only start with the events you're most in need of .
http://leelusoft.blogspot.com.au/p/watch-4-folder-25.html

Rob
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
MDT media deployment - no keyboard/mouse in Win PE 11 243
Tracking thousands of Internet devices 14 74
Memory usage extremely high on Windows 7 OS 25 90
Clone HDD in RAID1 10 120
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now