SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
error:3 - the system cannot find the path specified

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
error:3 - the system cannot find the path specified
Author Message
liangzhu



Joined: 30 Nov 2011
Posts: 42
Country: Singapore

Post error:3 - the system cannot find the path specified Reply with quote
Hi, i'm a total newbie at scripting, and i have run into some issues..perhaps somebody can shed some light onto this:

i get

line 69: error copying file C:\wherever\whatever.zip. error:3 - the system cannot find the path specified

what i am trying to do is:

FileRead (nfilecount,sReturn)
set ssend,sReturn

instr (ssend,"\ ",1,ndump1)
add ndump1, 2, ndump11
instr (ssend, "\ ",ndump11,ndump2)
add ndump2, 2, ndump21
instr (ssend,"\ ",ndump21,ndump3)

subtract ndump21, ndump11, ndump2
subtract ndump3, ndump21, ndump3
add ndump3, 2, ndump3


left (ssend,ndump1,sdump1)
mid (ssend, ndump11, ndump2, sdump2)
right (ssend, ndump3, sdump3)

Concat(ssource,sdestination,ssource)
Concat(scpoption,ssource,ssource)
FileSave ("c:\\scp.bat",ssource)
Runandwait ("c:\\scp.bat >>c:\\scp.log 2>&1", "","60", nscpid)
set ssource,""

FileExists(ssource,bexist)
If(bexist,nextfileset,sourceok)

SOURCEOK:

filecopyex ("C:\\wherever\\*.zip",sdump1,ssendcopyid1)
set sdump1,""
filecopyex ("C:\\wherever\\*.zip",sdump2,ssendcopyid2)
set sdump2,""
filecopyex ("C:\\wherever\\*.zip",sdump3,ssendcopyid3)
set sdump3,""

and line 69 is filecopyex ("C:\\wherever\\*.zip",sdump2,ssendcopyid2)

and from debug:

ssend is \\192.168.1.31\SharedDocs\exb\ \\192.168.1.31\SharedDocs\sun\ \\192.168.1.31\shareddocs\downloads\
sdump2 is \\192.168.1.31\SharedDocs\sun\
sdump3 is \\192.168.1.31\shareddocs\downloads\

from the JAL logs:

JAL 67: Executing FILECOPYEX("C:\wherever\*.zip", "\\192.168.1.31\SharedDocs\exb\", "0")
JAL 69: Executing FILECOPYEX("C:\wherever\*.zip", "\\192.168.1.31\SharedDocs\sun\", "0")

and the text file that i am reading from has these 2 lines, ssend is the 2nd line:

whatever.zip
\\192.168.1.31\SharedDocs\exb\ \\192.168.1.31\SharedDocs\sun\ \\192.168.1.31\shareddocs\downloads\
Wed Nov 30, 2011 2:33 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7841

Post Reply with quote
If line 67 does work, which is copying zip files to \\192.168.1.31\SharedDocs\exb\, and line 69 doesn't work, which is copying same files to \\192.168.1.31\SharedDocs\sun\, I would say that the second path is invalid, there is no such "sun' subfolder or insufficient permissions.

By the way, the trailing "\" in file path is not needed.

Other tip, line Runandwait ("c:\\scp.bat >>c:\\scp.log 2>&1", "","60", nscpid)
should be changed to Runandwait ("cmd /C c:\\scp.bat >> c:\\scp.log 2>&1", "","60", nscpid)

Redirect is a function of shell, not Windows. If you simply create a process using RunAndWait, it is not guaranteed to write any output anywhere. It may work for batch files, but won't work for executable files.
Wed Nov 30, 2011 9:07 am View user's profile Send private message
liangzhu



Joined: 30 Nov 2011
Posts: 42
Country: Singapore

Post does filecopyex 'lock' the source file? Reply with quote
hi, thanks for looking into this for me!

when i swap \\192.168.1.31\SharedDocs\sun\ and \\192.168.1.31\SharedDocs\exb\ around in the text file that i'm reading the paths from, and run the same code(i changed it to cmd /C though! thanks!), i get the same path not found error(yes, line 67 works, the file is successfully copied to \sun; but it is not copied to \exb) and in the JAL logs this:

JAL 67: FILECOPYEX
JAL 67: Executing FILECOPYEX("C:\wherever\*.zip", "\\192.168.1.31\SharedDocs\sun\", "0")
JAL Return "1"
JAL 68: SET
JAL 68: Executing SET("sdump1", "")
JAL 69: FILECOPYEX
JAL 69: Executing FILECOPYEX("C:\wherever\*.zip", "\\192.168.1.31\SharedDocs\exb\ ", "0")

(
1.i'm using 24x7 automation suite3.6.12, unregistered
2.in debug.log i find:
12/1/2011 9:54:40.085 2 215 0 DEBUG [THREAD 2488] New Job: An error occurred while executing 24x7 script: Line 69: Error copying file C:\wherever\whatever.zip. Error: 3 - The system cannot find the path specified.
3. i added "wait 30" between the filecopyex, the same error still occurs, except now its at line 70 because of the "wait 30"...
)

if i change the sequence to \sun then \downlaods then \exb, i get path not found also :

JAL 67: Executing FILECOPYEX("C:\wherever\*.zip", "\\192.168.1.31\SharedDocs\sun\", "0")
JAL Return "1"
JAL 68: SET
JAL 68: Executing SET("sdump1", "")
JAL 69: FILECOPYEX
JAL 69: Executing FILECOPYEX("C:\wherever\*.zip", "\\192.168.1.31\shareddocs\downloads\ ", "0")

it seems to be the 2nd path that is always not found...

and er, i left the trailing "\" in the paths because i'm trying to use "\ " as a deliminator to separate the paths in the line

\\192.168.1.31\SharedDocs\sun\ \\192.168.1.31\SharedDocs\exb\ \\192.168.1.31\shareddocs\downloads\

and i thought if i screwed up the positions, leaving a "\" or not having the "\" (and the space) is more forgiveable(than say,if i left a "," in the path)...
perhaps there are better ways to split a line into separate strings?
Wed Nov 30, 2011 10:23 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7841

Post Reply with quote
Try replacing
Code:
filecopyex ("C:\\wherever\\*.zip",sdump1,ssendcopyid1)
set sdump1,""
filecopyex ("C:\\wherever\\*.zip",sdump2,ssendcopyid2)
set sdump2,""
filecopyex ("C:\\wherever\\*.zip",sdump3,ssendcopyid3)
set sdump3,""


with
Code:
dim cmd, string
concat("cmd /C copy C:\\wherever\\*.zip ", sdump1, cmd)
RunAndWait(cmd, "", 0, ssendcopyid1)
concat("cmd /C copy C:\\wherever\\*.zip ", sdump2, cmd)
RunAndWait(cmd, "", 0, ssendcopyid2)
concat("cmd /C copy C:\\wherever\\*.zip ", sdump3, cmd)
RunAndWait(cmd, "", 0, ssendcopyid3)
set sdump1,""
set sdump2,""
set sdump3,""

Wed Nov 30, 2011 10:41 pm View user's profile Send private message
liangzhu



Joined: 30 Nov 2011
Posts: 42
Country: Singapore

Post changed to "," and filecopy Reply with quote
i have switched to using ", " as delim and have switched to filecopy instead of filecopyex to copy the file.

FileRead (nfilecount,sReturn)
set ssource,sReturn
set sarchival,sReturn
FileRead (nfilecount,sReturn)
set ssend,sReturn
concat("C:\\wherever\\",ssource,sdistribute)

instr (ssend,", ",1,ndump1)
add ndump1, 1, ndump11
instr (ssend, ", ",ndump11,ndump2)
add ndump2, 1, ndump21
instr (ssend,", ",ndump21,ndump3)

subtract ndump21, ndump11, ndump2
subtract ndump3, ndump21, ndump3
subtract ndump1,1,ndump1
subtract ndump2,1,ndump2


left (ssend,ndump1,sdump1)
mid (ssend, ndump11, ndump2, sdump2)
mid (ssend, ndump21, ndump3, sdump3)

Concat(ssource,sdestination,ssource)
Concat(scpoption,ssource,ssource)
FileSave ("c:\\scp.bat",ssource)
Runandwait ("cmd /C c:\\scp.bat >>c:\\scp.log 2>&1", "","60", nscpid)
set ssource,""

FileExists(ssource,bexist)
If(bexist,nextfileset,sourceok)

SOURCEOK:

filecopy (sdistribute,sdump1)
set sdump1,""
wait 30
filecopy (sdistribute,sdump2)
set sdump2,""
wait 30
filecopy (sdistribute,sdump3)
set sdump3,""
wait 30

now i get this in debug.log :
12/1/2011 11:39:48.804 2 215 0 DEBUG [THREAD 2328] New Job: An error occurred while executing 24x7 script: Line 68: Error copying file "C:\wherever\whatever.zip". Error: 5 - Access is denied.

in JAL logs:
JAL 68: Executing FILECOPY("C:\wherever\whatever.zip", "\\192.168.1.31\SharedDocs\sun")

in debug trace:
sdistribute is C:\DBSVickers-SGX\uat-dbsv-sgx-filesl.zip
sdump1 is "\\192.168.1.31\SharedDocs\sun"
sdump2 is " \\192.168.1.31\shareddocs\downloads"
sdump3 is " \\192.168.1.31\SharedDocs\exb"

i'll correct the space in front of sdump2 and sdump3....
Wed Nov 30, 2011 11:54 pm View user's profile Send private message
liangzhu



Joined: 30 Nov 2011
Posts: 42
Country: Singapore

Post sorry, its probably something to do with the machine Reply with quote
2 lines of filecopy also hit the error 5 access denied problem, at the 1st line:
filecopy "C:\\wherever\\whatever.zip", "C:\\destinationw"
filecopy "C:\\wherever\\whatever.zip", "C:\\destinationm"

although if i used a batch file and did xcopy it was ok.

the machine is a 32bit win2003 standard vm..i wonder what caused this...

if anyone could give me some pointers about this it'd be a great help!

sorry for the trouble i'd caused..
Thu Dec 01, 2011 3:03 am View user's profile Send private message
liangzhu



Joined: 30 Nov 2011
Posts: 42
Country: Singapore

Post thanks Reply with quote
sorry, i didn't see your reply with the cmd suggestion.

er, actually i originally wanted to implement the entire thing by reading from a list, then writing batch files on the fly to do all the actions, unless its easier to do it in JAL(e.g. isholiday).
what i'd found out was if i used run, i would also hit issues with path not found. but if i switched to runandwait, then it will all work fine.
i did a bit of that...
i imagine i'd be doing something like xcopy/y source destination1&xcopy/y source destination2&xcopy/y source destination3&xcopy/y source destination4 and so on so forth all in 1 line and it would probably all work...i think.....or i could split them and not abuse the "&"....

but i was told to do the same thing in JAL unless JAL did not function and thus i was exploring the filecopy and filecopyex functions.
e.g. the scp function. since the sftp server is key only and the version of 24x7 that is in use does not do key authentication(i think).

anyway i also replaced my clumsy instr,add,subtract,left, mid, etc with a loop and the gettoken command, so that it can work for more than 3 items in the list..
Thu Dec 01, 2011 3:17 am View user's profile Send private message
liangzhu



Joined: 30 Nov 2011
Posts: 42
Country: Singapore

Post update Reply with quote
changing the filemove to cmd,

the first location gets the file, the other 2 don't. no errors though. error code was 0, i think.

12/1/2011 17:46:03.187 0 0 0 DEBUG [THREAD 1276] Run: WaitFor return code: 0
12/1/2011 17:46:03.187 0 0 0 DEBUG [THREAD 1276] Run: OK
12/1/2011 17:46:03.250 0 0 0 DEBUG [THREAD 1276] Run: WaitFor return code: 0
12/1/2011 17:46:03.250 0 0 0 DEBUG [THREAD 1276] Run: OK
12/1/2011 17:46:07.968 0 0 0 DEBUG [THREAD 1276] Run: WaitFor return code: 0
12/1/2011 17:46:07.968 0 0 0 DEBUG [THREAD 1276] Run: OK
Thu Dec 01, 2011 5:41 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7841

Post Reply with quote
This is really weird.

Please add output redirect after copy and review errors if any

Code:
Dim cmd, string
ConcatEx("cmd /C copy C:\\wherever\\*.zip ", sdump1, " 2>&1 C:\\copy1.log", cmd)
RunAndWait(cmd, "", 0, ssendcopyid1)
ConcatEx("cmd /C copy C:\\wherever\\*.zip ", sdump2, " 2>&1 C:\\copy2.log", cmd)
RunAndWait(cmd, "", 0, ssendcopyid2)
ConcatEx("cmd /C copy C:\\wherever\\*.zip ", sdump3, " 2>&1 C:\\copy3.log", cmd)
RunAndWait(cmd, "", 0, ssendcopyid3)

Once you know what the root cause of the issue is, you can remove the logging. I also suggest trying to turn off your anti-virus software in case it is interfering in some way.
Thu Dec 01, 2011 9:11 am View user's profile Send private message
liangzhu



Joined: 30 Nov 2011
Posts: 42
Country: Singapore

Post sorry Reply with quote
as i mentioned the logic was changed to gettoken and filecopy was used instead of filecopyex.
one mistake was using a directory name as the destination for filecopy, when it was changed to a filename, that worked.
the other mistake was my placement of the end of the loop. it caused the loop to try to do the filecopy 1 more time than necessary, and filecopy to "" resulted in error. so the end of loop was fixed.

finally, just a lazy enquiry(i should do this myself to see,really), in the debug screen, is the loop supposed to stop at "endofloop" or at "loopuntil"? my loop stops at "loopuntil", with exit code 1, though all the actions i wanted to do, i thought were done.

thanks for all the suggestions!
Sun Dec 04, 2011 9:35 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7841

Post Reply with quote
The debugger can stop on executable statement lines only. Because labels are just mark-up lines, not executable statements, the debugger doesn't stop on labels.
Mon Dec 05, 2011 9:11 am View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.