I am attempting to write a VBScript to automate a routine ndmpcopy operation. I'm able to initiate the copy just fine, but I am not able to monitor it for completion. Below is the section that performs the copy and attempts to monitor for completion that performs an ndmpcopy from one qtree to another on the same filer:
sCmd = "cmd /c rsh " & sSrcFiler & " ndmpcopy " & aSrcPath & " " & aDestPath Set oExec = oShell.Exec(sCmd) Do While oExec.Status = 0 sStatusTxt = Now & " - ndmpcopy not complete. Will check again in 5 minutes." WScript.Echo(sStatusTxt) oLogFile.WriteLine sStatusTxt WScript.Sleep 300000 Loop sScreenOutput = oExec.StdOut.ReadAll WScript.Echo(sScreenOutput) If InStr(sScreenOutput,"Transfer successful") > 0 Then QuitGood Else QuitBad End If
This particular snippet will never get out of the Do...Loop. However, if I add the -n switch to the rsh command, after approximately 15 minutes it will complete. However, the ndmpcopy operation will abort and not complete in this scenario. Anyone have any ideas of a way to do this?