File Monitor - Date

Discuss RoboTask here
Post Reply
rwwilkins
Posts: 18
Joined: Tue Jan 10, 2012 5:35 pm

File Monitor - Date

Post by rwwilkins »

Hi Oleg,
I have two tasks you helped me with that are causing me issues. Every now and then the monitor recognizes all files as new and then generates a list with all files in the folder and then starts the main task of copying those files. The files arent changing dates or time stamps, but the system for some reason thinks they have been changed. Any ideas?

Here are the two tasks:

Code: Select all

;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|1967800045
Comment=STRINGLIST
ContinueOnError=INTEGER|0
Events=FOLDER
ExternalName=STRING|"Task54"
Hide=INTEGER|0
ID=INTEGER|1325874406
LogOnAsUser=INTEGER|1
Name=STRING|"ATT Asset Copy (collect names)"
OnErrorTaskID=INTEGER|0
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
WriteGeneralLog=INTEGER|0

[Actions]
Action1=FOLDER
Action2=FOLDER

[Actions\Action1]
ActionID=STRING|"A_TASKS_START"
Enabled=INTEGER|-1
Name=STRING|"Start Task ""Delayed run from monitor (main task)"""
Params=FOLDER

[Actions\Action1\Params]
parametercount=STRING|"0"
taskid=STRING|"967056664"
wait=STRING|"0"

[Actions\Action2]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""ASSETLIST"" with value ""{assetlist}{TextFile(C:\Processes\ATT\assetcopy.tx..."""
Params=FOLDER

[Actions\Action2\Params]
expand=STRING|"1"
varname=STRING|"ASSETLIST"
varvalue=STRING|"{assetlist}{TextFile(C:\Processes\ATT\assetcopy.txt)}{EOL}"

[Events]
Event1=FOLDER

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

[Events\Event1\Params]
chg=STRING|"1"
chga=STRING|"1"
chgsl=STRING|"1"
chgsm=STRING|"1"
chgtl=STRING|"1"
chgtm=STRING|"1"
del=STRING|"0"
folder1=STRING|"Z:\ATT\Assets"
foldercount=STRING|"1"
incmask=STRING|"*.mpg"
interval=STRING|"10"
listmode=STRING|"1"
mon_files=STRING|"1"
mon_folders=STRING|"0"
new=STRING|"1"
onelist=STRING|"C:\Processes\ATT\assetcopy.txt"
pass=STRING|"0"
passmode=STRING|"1"
saveresults=STRING|"1"
subfolders1=STRING|"0"
--------------------------------------------------------------------------------------------------

Code: Select all

;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|1967800045
Comment=STRINGLIST
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task55"
Hide=INTEGER|0
ID=INTEGER|967056664
LocalVariables=STRING|"M_FILE,LocalFileList"
LogOnAsUser=INTEGER|1
Name=STRING|"ATT Asset Copy (Main task)"
OnErrorTaskID=INTEGER|0
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
WriteGeneralLog=INTEGER|0

[Actions]
Action1=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER
Action5=FOLDER
Action6=FOLDER
Action7=FOLDER
Action8=FOLDER
Action9=FOLDER

[Actions\Action1]
ActionID=STRING|"A_GENERAL_PAUSE"
Enabled=INTEGER|-1
Name=STRING|"Delay 90000 ms"
Params=FOLDER

[Actions\Action1\Params]
delay=STRING|"900"

[Actions\Action2]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""ASSETFILELIST"" with value ""{assetlist}"""
Params=FOLDER

[Actions\Action2\Params]
expand=STRING|"1"
varname=STRING|"ASSETFILELIST"
varvalue=STRING|"{assetlist}"

[Actions\Action3]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""ASSETLIST"" with value """""
Params=FOLDER

[Actions\Action3\Params]
expand=STRING|"1"
varname=STRING|"ASSETLIST"

[Actions\Action4]
ActionID=STRING|"A_LOOP_TEXT"
Enabled=INTEGER|-1
Name=STRING|"Text Loop"
Params=FOLDER

[Actions\Action4\Params]
destvar=STRING|"Y_FILE"
file=STRING|"C:\Processes\Seachange\sdschedlist.txt"
line0=STRING|"{AssetFileList}"
linecount=STRING|"1"
sourcetext=STRING|"1"

[Actions\Action5]
ActionID=STRING|"A_FILE_COPY"
Enabled=INTEGER|-1
Name=STRING|"Copy/Move File"
Params=FOLDER

[Actions\Action5\Params]
destdir=STRING|"Z:\ATT\Assets\Outgoing"
f_count=STRING|"1"
file0=STRING|"{Y_FILE}"
hidden=STRING|"1"
ifexists=STRING|"0"
move=STRING|"0"
subdir=STRING|"0"
system=STRING|"1"

[Actions\Action6]
ActionID=STRING|"A_ROBOTASK_LOG"
Enabled=INTEGER|-1
Name=STRING|"Log Message"
Params=FOLDER

[Actions\Action6\Params]
message=STRING|"{Y_FILE} copied to Outgoing"
type=STRING|"0"

[Actions\Action7]
ActionID=STRING|"A_LOOP_END"
Enabled=INTEGER|-1
Name=STRING|"End Loop"

[Actions\Action8]
ActionID=STRING|"A_FILE_TEXTWRITE"
Enabled=INTEGER|-1
Name=STRING|"Create text file C:\Processes\ATT\AssetFileList.txt"
Params=FOLDER

[Actions\Action8\Params]
fileexists=STRING|"0"
filname=STRING|"C:\Processes\ATT\AssetFileList.txt"
line0=STRING|"{AssetFileList}"
linecount=STRING|"1"
suppress=STRING|"0"

[Actions\Action9]
ActionID=STRING|"A_INET_SENDMAIL"
Enabled=INTEGER|-1
Name=STRING|"Send Email"
Params=FOLDER

[Actions\Action9\Params]
attach0=STRING|"C:\Processes\ATT\AssetFileList.txt"
attachcount=STRING|"1"
auth=STRING|"0"
cc=STRING|"richard.lewis@mybrighthouse.com"
charset=STRING|"iso-8859-1"
from=STRING|"robotask@mybrighthouse.com"
host=STRING|"tbmailrelay.corp.local"
html=STRING|"0"
msg0=STRING|"Robotask has completed copying the files CURRENTLY scanned by Robotask."
msg2=STRING|"Please note, as content comes in, the process may complete multiple times and you will receive a different list of completed content with each email."
msgcount=STRING|"3"
password=STRING|"2540125966254572519326985"
passwordmode=STRING|"0"
port=STRING|"25"
SSL=STRING|"0"
subject=STRING|"ATT Asset Copy completed"
to=STRING|"richard.wilkins@mybrighthouse.com"
Oleg
Site Admin
Posts: 3202
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: File Monitor - Date

Post by Oleg »

Do you mean that File Monitor makes false launching of the task?

I see that the trigger catches all changes in your task: time changes, size changes and attributes changes.
Each of these parameters can be cause of the event triggering.
The time of local files is stored to the millisecond. Most file explorers (file managers) show the time accurate within seconds only.
Oleg Yershov
rwwilkins
Posts: 18
Joined: Tue Jan 10, 2012 5:35 pm

Re: File Monitor - Date

Post by rwwilkins »

Yes, it launches when no file date or time changes have been made. It essentially believes all files are new and starts processing them.
Oleg
Site Admin
Posts: 3202
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: File Monitor - Date

Post by Oleg »

File monitor saves the list of files between sessions in order to save folder status when trigger is being stopped.
It saves lists into {TempDir}\RoboTaskFileList folder

Check please, maybe some task (or program) rewrites these files.
Oleg Yershov
Oleg
Site Admin
Posts: 3202
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: File Monitor - Date

Post by Oleg »

Another comment:
File monitor doesn't rewrite file if files list is empty.
I recommend you to remove file with the list of files in the task.
You can add 3-rd step "Delete file" into 1-st task (ATT Asset Copy (collect names))
Oleg Yershov
Post Reply