I am using the nice http://www.jcraft.com/jsch/ library - however when I run some commands, I see that jsch returns a getExitStatus of -1, from time to time, even though the script ran fine (when I run it by hand it is consistently a successful 0 exit code). Any ideas?
(seems to happen to a wide variety of commands)
I gave up on Jsch - and its incredibly unhelpful API and switched to:
http://www.cleondris.ch/opensource/ssh2/
(Ganymede SSH2). I do a LOT with ssh in the JVM and over months of 24 hour usage ganymede has proven far more reliable. And more pleasant. My main remaining gripe is around being apparently unable to set timeouts for SCP.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With