Copy/move causes task to abort

Discuss RoboTask here
Post Reply
stevefromdodge
Posts: 30
Joined: Tue Apr 05, 2011 3:39 pm

Copy/move causes task to abort

Post by stevefromdodge »

As part of my server monitoring system, I'm setting up tasks to write a file to each of my file shares. I'm using "Copy/Move File" to copy a tiny text file to the share. My idea was to use {IsError} to determine the success or failure and then send an email in the event of a failure.The problem is that if "Copy/Move File" tries to write to a non-existent folder, it's aborting the task, rather than returning an error code and continuing the task.Ideas? 
stevefromdodge
Posts: 30
Joined: Tue Apr 05, 2011 3:39 pm

Copy/move causes task to abort

Post by stevefromdodge »

Still working on this one. I've tried "Copy/Move File", "Write text file" and "Change folder".  All are having the same problem.


Last edited by stevefromdodge on Thu Jun 30, 2011 7:11 pm, edited 1 time in total.
Oleg
Site Admin
Posts: 3202
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Copy/move causes task to abort

Post by Oleg »

The problem is that if "Copy/Move File" tries to write to a non-existent folder, it's aborting the task
I've just tested this.
If the target folder doesn't exist the action creates requested folder (of course if the folder have valid name)
Probably you have no enough rights to create folder or the folder name is invalid.
stevefromdodge
Posts: 30
Joined: Tue Apr 05, 2011 3:39 pm

Copy/move causes task to abort

Post by stevefromdodge »

Oleg wrote:I've just tested this.
If the target folder doesn't exist the action creates requested folder (of course if the folder have valid name)
Probably you have no enough rights to create folder or the folder name is invalid.
I probably could have phrased it better. If I try to copy a file to \\server\share\folder and the server is offline, the task aborts.
Last edited by stevefromdodge on Mon Jul 11, 2011 10:27 pm, edited 1 time in total.
Oleg
Site Admin
Posts: 3202
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Copy/move causes task to abort

Post by Oleg »

I probably could have phrased it better. If I try to copy a file to \\server\share\folder and the server is offline, the task aborts.
If server is offline you can't copy files to network folder in any case.

Try to check the server existence. I use the action "Ping host" to check whether server is active.

see the example below:

;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************

[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|101188231
Comment=STRINGLIST
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task243"
Hide=INTEGER|0
ID=INTEGER|2048670453
LocalVariables=STRING|"ping"
LogOnAsUser=INTEGER|1
Name=STRING|"Copy/Move File to nonexisting folder"
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

[Actions\Action1]
ActionID=STRING|"A_INET_PING"
Enabled=INTEGER|-1
Name=STRING|"Ping xp-pro"
Params=FOLDER

[Actions\Action1\Params]
default=STRING|"-1"
host=STRING|"xp-pro"
timeout=STRING|"5000"
variable=STRING|"PING"

[Actions\Action2]
ActionID=STRING|"A_FLOW_IF"
Enabled=INTEGER|-1
Name=STRING|"If Then"
Params=FOLDER

[Actions\Action2\Params]
case=STRING|"0"
operator=STRING|"2"
type=STRING|"1"
value1=STRING|"{ping}"
value2=STRING|"0"

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

[Actions\Action3\Params]
destdir=STRING|"\\XP-PRO\share\nofolder"
f_count=STRING|"1"
file0=STRING|"C:\incoming\commatext.txt"
hidden=STRING|"1"
ifexists=STRING|"0"
move=STRING|"0"
subdir=STRING|"0"
system=STRING|"1"

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

[Actions\Action5]
ActionID=STRING|"A_DIALOG_MESSAGE"
Enabled=INTEGER|-1
Name=STRING|"Show ""Prabably server is down!!"""
Params=FOLDER

[Actions\Action5\Params]
icon=STRING|"0"
msg0=STRING|"Prabably server is down!!"
msgcount=STRING|"1"
playsound=STRING|"0"
showmessage=STRING|"1"

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

Last edited by Oleg on Tue Jul 12, 2011 8:56 am, edited 1 time in total.
stevefromdodge
Posts: 30
Joined: Tue Apr 05, 2011 3:39 pm

Copy/move causes task to abort

Post by stevefromdodge »

The greater scope of my project is to test all of the various components of our network and send notifications if anything fails. I ping each server first, but that's really just checking if the server is alive. If the server responds to ping, then I test each of the user resources on the server. I'm checking email, ftp, web services, file shares, whatever each server might provide.In this specific task, I'm looking to test if a network folder can be written to. This might fail if the server was offline, if it was full, if the security context couldn't be resolved, if DNS failed, maybe other reasons. What I'm hoping to do is write a file to the share and return an error code if the operation fails. I can then key off that error code to send notifications that the server has issues.
Oleg
Site Admin
Posts: 3202
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Copy/move causes task to abort

Post by Oleg »

I'm checking email, ftp, web services, file shares
You have to test it directly: send/receive email, upload/download some FTP file, download main page of the site(for example), copy file to/from network folder and etc.

If task raises an error you can run "error handler" task.
You can send email to you (or other notification) with description of error (task, step, error message, etc).
Open the task editor -> Advanced tab
see "If error occurred" parameter.
Also read here
stevefromdodge
Posts: 30
Joined: Tue Apr 05, 2011 3:39 pm

Copy/move causes task to abort

Post by stevefromdodge »

Thanks Oleg; the "If error occurred" parameter was the key. I was able to get the task working after I changed it to "Continue Execution". 
Post Reply