O verlapping tasks

Discuss RoboTask here
Post Reply
deesloop
Posts: 70
Joined: Wed Feb 25, 2009 3:44 am

O verlapping tasks

Post by deesloop »

I want a task to run every minute

The task pings a location once a minute for 8 minutes
if those pings fail it is assumed there is a power failure, so initiates a shutdown 2 minutes after sending an email warning of this

As you can see there is a potential overlap of several minutes

How do i get round this please?

I did think of changinG the echo the date to c:\powerfail.txt and use a file monitor task but it isn't working...

Any pointers?

Thanks

Code: Select all

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

[Actions]
Action1=FOLDER
Action10=FOLDER
Action11=FOLDER
Action12=FOLDER
Action13=FOLDER
Action14=FOLDER
Action15=FOLDER
Action16=FOLDER
Action17=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER
Action5=FOLDER
Action6=FOLDER
Action7=FOLDER
Action8=FOLDER
Action9=FOLDER

[Actions\Action1]
ActionID=STRING|"A_VARIABLES_CREATE"
Enabled=INTEGER|-1
Name=STRING|"Create local variable ""NOPING"" with value """""
Params=FOLDER

[Actions\Action1\Params]
expand=STRING|"0"
varkind=STRING|"1"
varname=STRING|"NOPING"

[Actions\Action10]
ActionID=STRING|"A_FLOW_ENDIF"
Enabled=INTEGER|-1
Name=STRING|"End If"

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

[Actions\Action12]
ActionID=STRING|"A_FLOW_IF"
Enabled=INTEGER|-1
Name=STRING|"if 8 failed pings"
Params=FOLDER

[Actions\Action12\Params]
case=STRING|"0"
operator=STRING|"0"
type=STRING|"0"
value1=STRING|"{PINGFAILS}"
value2=STRING|"8"

[Actions\Action13]
ActionID=STRING|"A_INET_SENDMAIL"
Enabled=INTEGER|-1
Name=STRING|"Warn of power off"
Params=FOLDER

[Actions\Action13\Params]
attachcount=STRING|"0"
auth=STRING|"0"
charset=STRING|"iso-8859-1"
from=STRING|"robotask@domain.com"
host=STRING|"172.16.64.3"
html=STRING|"0"
msg0=STRING|"8 successive attempts to contact the network have failed"
msg1=STRING|"It is assumed there is a power failure and the servers will shut down in 2 minutes."
msgcount=STRING|"3"
password=STRING|"2642526733264732673612345"
passwordmode=STRING|"0"
port=STRING|"25"
SSL=STRING|"0"
subject=STRING|"8th Network failure"
to=STRING|"me@domain.com"

[Actions\Action14]
ActionID=STRING|"A_GENERAL_PAUSE"
Enabled=INTEGER|-1
Name=STRING|"Delay 2 mins"
Params=FOLDER

[Actions\Action14\Params]
delay=STRING|"1200"

[Actions\Action15]
ActionID=STRING|"A_FILE_TEXTWRITE"
Enabled=INTEGER|-1
Name=STRING|"Create text file C:\POWERFAIL.TXT"
Params=FOLDER

[Actions\Action15\Params]
encode=STRING|"0"
fileexists=STRING|"1"
filname=STRING|"C:\POWERFAIL.TXT"
line0=STRING|"{Time} {Date}"
linecount=STRING|"1"
suppress=STRING|"0"

[Actions\Action16]
ActionID=STRING|"A_FLOW_ELSE"
Enabled=INTEGER|-1
Name=STRING|"Else"

[Actions\Action17]
ActionID=STRING|"A_FLOW_ENDIF"
Enabled=INTEGER|-1
Name=STRING|"End If"

[Actions\Action2]
ActionID=STRING|"A_VARIABLES_CREATE"
Enabled=INTEGER|-1
Name=STRING|"Create local variable ""PINGFAILS"" with value ""0"""
Params=FOLDER

[Actions\Action2\Params]
expand=STRING|"0"
varkind=STRING|"1"
varname=STRING|"PINGFAILS"
varvalue=STRING|"0"

[Actions\Action3]
ActionID=STRING|"A_LOOP_SIMPLE"
Enabled=INTEGER|-1
Name=STRING|"Loop 8 times"
Params=FOLDER

[Actions\Action3\Params]
begin=STRING|"1"
end=STRING|"8"

[Actions\Action4]
ActionID=STRING|"A_INET_PING"
Enabled=INTEGER|-1
Name=STRING|"Ping network"
Params=FOLDER

[Actions\Action4\Params]
default=STRING|"-1"
host=STRING|"172.16.64.207"
timeout=STRING|"100"
variable=STRING|"NOPING"

[Actions\Action5]
ActionID=STRING|"A_FLOW_IF"
Enabled=INTEGER|-1
Name=STRING|"If ping response"
Params=FOLDER

[Actions\Action5\Params]
case=STRING|"0"
operator=STRING|"3"
type=STRING|"1"
value1=STRING|"{NOPING}"
value2=STRING|"-1"

[Actions\Action6]
ActionID=STRING|"A_FLOW_ELSE"
Enabled=INTEGER|-1
Name=STRING|"Else"

[Actions\Action7]
ActionID=STRING|"A_VARIABLES_INCREMENT"
Enabled=INTEGER|-1
Name=STRING|"Increment PINGFAILS"
Params=FOLDER

[Actions\Action7\Params]
incement=STRING|"1"
vaiable=STRING|"PINGFAILS"

[Actions\Action8]
ActionID=STRING|"A_INET_SENDMAIL"
Enabled=INTEGER|-1
Name=STRING|"Send Email with attempt number"
Params=FOLDER

[Actions\Action8\Params]
attachcount=STRING|"0"
auth=STRING|"0"
charset=STRING|"iso-8859-1"
from=STRING|"robotask@domain.com"
host=STRING|"172.16.64.3"
html=STRING|"0"
msg0=STRING|"The network at 172.16.64.xxx is not responding"
msg1=STRING|"This could be a power issue and requires the servers to be shut down."
msgcount=STRING|"2"
password=STRING|"2514526738246872545812345"
passwordmode=STRING|"0"
port=STRING|"25"
SSL=STRING|"0"
subject=STRING|"No network response - Failure number {PINGFAILS}"
to=STRING|"me@domain.com"

[Actions\Action9]
ActionID=STRING|"A_GENERAL_PAUSE"
Enabled=INTEGER|-1
Name=STRING|"Wait a minute"
Params=FOLDER

[Actions\Action9\Params]
delay=STRING|"600"

[Events]
Event1=FOLDER

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

[Events\Event1\Params]
id=STRING|"1NZHV21V"
interval=STRING|"60"


On file change task - never runs.
[code]
;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|0
Comment=STRINGLIST
ContinueOnError=INTEGER|0
Events=FOLDER
ExternalName=STRING|"Task5"
Hide=INTEGER|0
ID=INTEGER|1058326044
LogOnAsUser=INTEGER|1
Name=STRING|"Check file and shutdown"
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_FILE_DELETE"
Enabled=INTEGER|-1
Name=STRING|"Delete File"
Params=FOLDER

[Actions\Action1\Params]
Count=STRING|"1"
deletedirs=STRING|"0"
file0=STRING|"C:\POWERFAIL.TXT"
hidden=STRING|"0"
subdir=STRING|"0"
system=STRING|"0"
ToRecycleBin=STRING|"0"

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

[Actions\Action2\Params]
attachcount=STRING|"0"
auth=STRING|"0"
charset=STRING|"iso-8859-1"
from=STRING|"robotask@domain.com"
host=STRING|"172.16.64.3"
html=STRING|"0"
msg0=STRING|"Enter message body"
msgcount=STRING|"1"
password=STRING|"2488924938269912596212399"
passwordmode=STRING|"0"
port=STRING|"25"
SSL=STRING|"0"
subject=STRING|"file change"
to=STRING|"me@domain.co.uk"

[Events]
Event1=FOLDER

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

[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|"C:\"
foldercount=STRING|"1"
incmask=STRING|"POWERFAIL.TXT"
interval=STRING|"10"
listmode=STRING|"1"
mon_files=STRING|"0"
mon_folders=STRING|"1"
new=STRING|"0"
pass=STRING|"0"
passmode=STRING|"1"
saveresults=STRING|"0"
subfolders1=STRING|"0"

Oleg
Site Admin
Posts: 3032
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: O verlapping tasks

Post by Oleg »

I want a task to run every minute
What is the problem? Configure "Cyclic" event to start the task every 60 seconds.

Each task can be running only once at a time. Cyclic trigger will try to start the task every minute. If the task is already running you will see such message in the system log
Task "<task-name>" is already running

nothing more. The task will not be started twice.
Oleg Yershov
deesloop
Posts: 70
Joined: Wed Feb 25, 2009 3:44 am

Re: O verlapping tasks

Post by deesloop »

Thanks fro that.
Post Reply