Page 1 of 1

File Monitor Task Not Polling

Posted: Tue Dec 12, 2017 5:43 pm
by elwayfan446
Hi Oleg,

I am trying to use a file monitor task to watch for changes to a .pdf file in a folder and send an email with that file if the modified date has been changed since the task last ran. I am running into problems. First, the task doesn't seem to be polling on its own. The only way I could get it to run is manually or adding a "cyclical" trigger before the File Monitor trigger. However, when I did that, It send the file even if the modified date hadn't been changed. Am I setting this up wrong? I have attached a screenshot.

Re: File Monitor Task Not Polling

Posted: Tue Dec 12, 2017 7:38 pm
by Oleg
Look at the screenshot
filemon.png
filemon.png (53.05 KiB) Viewed 22126 times
Why do you turn off all criteria of changes? What do you want to monitor? You turned off all criteria, so file monitor can't detect any changes. File monitor doesn't analyze file content.
Usually you all criteria are switched on. When some program changes file then system change file date-time of last changes. In most cases file changes its size.

You can switch off "Monitor Folders" checkbox. It is for folders only (not for files)

Re: File Monitor Task Not Polling

Posted: Tue Dec 12, 2017 8:15 pm
by elwayfan446
Oleg wrote:Look at the screenshot
filemon.png
Why do you turn off all criteria of changes? What do you want to monitor? You turned off all criteria, so file monitor can't detect any changes. File monitor doesn't analyze file content.
Usually you all criteria are switched on. When some program changes file then system change file date-time of last changes. In most cases file changes its size.

You can switch off "Monitor Folders" checkbox. It is for folders only (not for files)
I had the time changed option on, however, it still didn't work unless I manually ran it or had that cyclical trigger added. I only want to send the email if the file was modified (time changed) since the last time the trigger polled the file.

I also tried this with just the "monitor file" option checked.

Re: File Monitor Task Not Polling

Posted: Tue Dec 12, 2017 8:21 pm
by elwayfan446
So I changed the settings to what you see below. I have it set to poll every 15 seconds. I know the file has changed since I enabled this. However, as you can see, it has not run since I manually ran it this morning.

Re: File Monitor Task Not Polling

Posted: Tue Dec 12, 2017 8:53 pm
by Oleg
I created small example (see below) with similar parameters of file monitor.
It works. When I change some PDF file the task has been started.
I use File monitor in my job very often.

Code: Select all

;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|1217966092
Comment=STRINGLIST
ContinueOnError=INTEGER|0
Events=FOLDER
ExternalName=STRING|"Task239"
Hide=INTEGER|0
ID=INTEGER|834167994
LogOnAsUser=INTEGER|1
Name=STRING|"test monitor PDF"
OnErrorTaskID=INTEGER|-1
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
UnicodeFormat=INTEGER|1
WriteGeneralLog=INTEGER|0

[Actions]
Action1=FOLDER

[Actions\Action1]
ActionID=STRING|"A_ROBOTASK_ALERT"
Enabled=INTEGER|-1
Name=STRING|"Show Notification"
Params=FOLDER

[Actions\Action1\Params]
defh=STRING|"1"
defw=STRING|"1"
duration=STRING|"5"
height=STRING|"76"
icon=STRING|"1"
kind=STRING|"0"
message=STRING|"File changed"
position=STRING|"3"
title=STRING|"monitor"
width=STRING|"330"

[Events]
Event1=FOLDER

[Events\Event1]
Enabled=INTEGER|-1
EventID=STRING|"E_FILE_MONITOR"
Params=FOLDER
UniqueID=INTEGER|-2084249338

[Events\Event1\Params]
chg=STRING|"1"
chga=STRING|"0"
chgsl=STRING|"0"
chgsm=STRING|"0"
chgtl=STRING|"1"
chgtm=STRING|"1"
del=STRING|"0"
folder1=STRING|"D:\temp"
foldercount=STRING|"1"
incmask=STRING|"*.pdf*"
interval=STRING|"15"
listmode=STRING|"1"
mon_files=STRING|"1"
mon_folders=STRING|"0"
new=STRING|"0"
pass=STRING|"0"
passmode=STRING|"1"
required=STRING|"0"
saveresults=STRING|"0"
subfolders1=STRING|"0"
Save the text of the task to a file and use menu Task->Import to import the task into RoboTask.
Do not forget to enable the task after importing.

Re: File Monitor Task Not Polling

Posted: Tue Dec 12, 2017 8:55 pm
by Oleg
I think that disk M is mapped network drive
How do you use RoboTask: as simple application or as system service?

Re: File Monitor Task Not Polling

Posted: Tue Dec 12, 2017 9:20 pm
by elwayfan446
Oleg wrote:I think that disk M is mapped network drive
How do you use RoboTask: as simple application or as system service?
You are correct, it is a mapped network drive. I use it as a simple application on my machine. If I run manually, it sees the drive. Does it need to be qualified with a UNC path in order to poll correctly?

Re: File Monitor Task Not Polling

Posted: Tue Dec 12, 2017 9:25 pm
by elwayfan446
What I can't figure out is why it doesn't even look like the task is running? The last start still shows the last time I manually kicked it off.

Re: File Monitor Task Not Polling

Posted: Wed Dec 13, 2017 9:17 am
by Oleg
It's necessary to investigate this.
There are several reasons:
  • - you specify wrong path. For example the target PDF is in another folder with similar name. I made such mistake many times too.
    - PDF file is in some sub-folder of specified folder. But I see that you specify the folder without sub-folders in the trigger parameters. This mistake is very frequent too.
    - PDF file doesn't change own date-time for some reason.
    - maybe something else
Try the simple example on local drive. If it works then it means that you do something wrong in main task

Re: File Monitor Task Not Polling

Posted: Wed Dec 13, 2017 4:06 pm
by elwayfan446
Oleg,

I have it working now. It was strange, even though the file wasn't in a subfolder, I checked that option and it worked. I turned it off again and it worked. Who knows. It is working though and doing exactly what I needed it to do. Thanks for all of your help!