Monitor for new files and send an email

Discuss RoboTask here
Post Reply
dbortunk
Posts: 27
Joined: Mon Jun 08, 2009 10:38 am

Monitor for new files and send an email

Post by dbortunk »

Is there a way to monitor a folder tree (tree contains many subfolders) for any new or changed file and send an email for each file based on it's subfolder. Basically the new file would have to be able to go into a variable and then based on it's subfolder location send an email with that file name.
Oleg
Site Admin
Posts: 3202
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Monitor for new files and send an email

Post by Oleg »

File monitor triggering event can monitor files in subfolders too. Turn on corresponding checkbox while adding the folder.
Also it can save the list of changed, deleted or added files in one file or in separated text files. Look at Save changes tab in the event editor.
dbortunk
Posts: 27
Joined: Mon Jun 08, 2009 10:38 am

Monitor for new files and send an email

Post by dbortunk »

I did that. It only works if i place one file in a folder. If i place three different files into the same folder or multiple folders, it only works for one file.
Oleg
Site Admin
Posts: 3202
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Monitor for new files and send an email

Post by Oleg »

Send me the example of your task.

We have tested this. It's working.
Last edited by Oleg on Wed Jun 10, 2009 1:14 pm, edited 1 time in total.
dbortunk
Posts: 27
Joined: Mon Jun 08, 2009 10:38 am

Monitor for new files and send an email

Post by dbortunk »

;*******************************
;* RoboTask Task file          *
;* Do not edit in text editor! *
;*******************************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|0
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task11"
Hide=INTEGER|0
ID=INTEGER|1973519574
LogOnAsUser=INTEGER|1
Name=STRING|"Remove Empty Folder (c:\temp\a\*)..."
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
[Actions\Action1]
ActionID=STRING|"A_LOOP_FILE"
Enabled=INTEGER|-1
Name=STRING|"File Loop"
Params=FOLDER
[Actions\Action1\Params]
createmode=STRING|"1"
date1=STRING|"20090610"
date2=STRING|"20090610"
destvar=STRING|"CURRENTFOLDER"
DuringDays=STRING|"1"
DuringMonths=STRING|"1"
file0=STRING|"c:\temp\*"
filecount=STRING|"1"
OlderDays=STRING|"1"
OlderMonths=STRING|"1"
savesize=STRING|"0"
searchkind=STRING|"1"
subdirs=STRING|"1"
timesize=STRING|"0"
WithoutPath=STRING|"0"
[Actions\Action2]
ActionID=STRING|"A_FLOW_IF"
Enabled=INTEGER|-1
Name=STRING|"If Then"
Params=FOLDER
[Actions\Action2\Params]
case=STRING|"0"
operator=STRING|"0"
type=STRING|"0"
value1=STRING|"{FolderSize({CurrentFolder})}"
value2=STRING|"0"
[Actions\Action3]
ActionID=STRING|"A_FOLDER_REMOVE"
Enabled=INTEGER|-1
Name=STRING|"Remove Empty Folder ({CurrentFolder})"
Params=FOLDER
[Actions\Action3\Params]
deletefolder=STRING|"0"
folder=STRING|"{CurrentFolder}"
[Actions\Action4]
ActionID=STRING|"A_FLOW_ENDIF"
Enabled=INTEGER|-1
Name=STRING|"End If"
[Actions\Action5]
ActionID=STRING|"A_LOOP_END"
Enabled=INTEGER|-1
Name=STRING|"End Loop"
 
Oleg
Site Admin
Posts: 3202
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Monitor for new files and send an email

Post by Oleg »

Where is "File monitor" event in this task?
Oleg
Site Admin
Posts: 3202
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Monitor for new files and send an email

Post by Oleg »

BTW: this task is working well, I've just tested this on different variants
dbortunk
Posts: 27
Joined: Mon Jun 08, 2009 10:38 am

Monitor for new files and send an email

Post by dbortunk »

[Events]
Event1=FOLDER
[Events\Event1]
Enabled=INTEGER|-1
EventID=STRING|"E_FILE_MONITOR"
Params=FOLDER
[Events\Event1\Params]
chg=STRING|"0"
chga=STRING|"1"
chgsl=STRING|"1"
chgsm=STRING|"1"
chgtl=STRING|"1"
chgtm=STRING|"1"
del=STRING|"0"
folder1=STRING|"C:\incoming"
foldercount=STRING|"1"
id=STRING|"CDTRVYQP4"
incmask=STRING|"*.*"
interval=STRING|"10"
listmode=STRING|"2"
mon_files=STRING|"1"
mon_folders=STRING|"0"
new=STRING|"1"
newlist=STRING|"c:\new_files.txt"
saveresults=STRING|"1"
subfolders1=STRING|"1"
 
Post Reply