WatchDirectory Forum
http://www.watchdirectory.net/cgi-bin/yabb25/YaBB.pl
watchDirectory forums >> Plugins >> Monitor Folder Size can't use file age method
http://www.watchdirectory.net/cgi-bin/yabb25/YaBB.pl?num=1374151006

Message started by niallb on Jul 18th, 2013 at 2:36pm

Title: Monitor Folder Size can't use file age method
Post by niallb on Jul 18th, 2013 at 2:36pm
Hi,

I have set up a task using the Monitor Folder Size plugin to send an email if there are more than 10 files in a folder and the oldest has been there over an hour, however this seems to be sending an alert immediately.

Setup:
When there are more than XXX files send an email alert every 80 minutes - XXX is set to 10
Monitoring Method:
Use the 'file age' monitoring method, Trigger for files older than 1 hours using latest of Creation/Modified, Poll every 10 minutes, remember triggered files.

I've put on debug mode and a snippet of the log seems to confirm that the plugin is ignoring the events:

11:17:23 walkdir...
11:17:23 DMFA - Walking directory \\server\monitoredfolder
11:17:23 \\server\monitoredfolder\file1.txt using date 18/07/2013 10:42:34 ** file is not old enough
...
11:17:23 \\server\monitoredfolder\file11.txt using date 18/07/2013 11:00:03 ** file is not old enough
11:17:23 DMFA - Waiting for timeout
11:17:28 checking....
11.17:28 Found 11 files inside the directory \\server\monitoredfolder\
11:17:28 triggered!
11:17:28 waiting....
11:27:23 DMFA - waitable timer said tick

This resulted in the following message:

There are more than 10 files in directory \\server\monitoredfolder\.
Found 11 files.

This messages was generated on computer ABC, timestamp 18/07/2013 11:17:28

Thanks,
Niall

Title: Re: Monitor Folder Size can't use file age method
Post by Gert on Jul 19th, 2013 at 7:58am
Hello Niall,

WD is implemented in 2 "parts":
the part that scans directories, looking for changes - the monitor
the part that acts on those changes - the plugins/tasks

All plugins/tasks get called by the monitor when a change is detected so they can do their job. The monitor tells the plugin the name of the detected file and the plugin (for example) copies or emails the file.

The Folder size plugin - http://www.watchdirectory.net/wdhelp/plugins/wdopFolderSize.html
works a bit different. When it is called by the monitoring part it ignores the detected file and does its own scan of the directory, for example to determine how many files are present.

I guess you need to use the email task ( http://www.watchdirectory.net/wdhelp/plugins/wdopAutoEmail.html ) together with the File Age monitoring method to check for "old files". Make sure to use the "combine emails" option to prevent receiving emails for each old file separately.

Title: Re: Monitor Folder Size can't use file age method
Post by niallb on Jul 19th, 2013 at 2:14pm
Gert,

Thank you - that makes a lot of sense.

Niall

WatchDirectory Forum » Powered by YaBB 2.5.2!
YaBB Forum Software © 2000-2017. All Rights Reserved.