java - Intermittent issue with jsch while trying to run a shell script -


I am trying to execute a shell script (which is in a separate UNIX server) Now I have noticed that sometimes this script was unable to execute. Since that script takes a lot of time to execute, I can not wait / read / wait for the output. Just wanted to make sure that the script ran every time.

  JSch jsch = new JSch (); String CMD = "CD / Blackdock / TFS / TFS Connector; ./runTFSConnector_web; Session = jsch.get session (" UserID ", Host IP, 22); session.Set UsernameInfo (New SSHISINInfo (" password "); session. Connect (); channel = session.onpanel ("f"); ((xxxx xxx channel) .set comand (cmd); channel.connect; while ((! Channel.icclosed ()) {thread.sleep (3000 );}  

I have closed the loop so that the channel is closed.

Please give some solution. Suggestions will be very commendable.


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -