Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm using http://phpseclib.sourceforge.net/ to make an SSH connection to my server, then execute an SCP command to transfers to a remote server. The library's exec() method returns a string (looks like the standard output of the SCP command) instead of the return value of the command (e.g. 0 to indicate success).

I'm reluctant to do some sort of string comparison to determine if the SCP transfer was successful or not (right now, I get "stdin: is not a tty"). Is there an SSH command I can use to determine if a file exist on another server? Or any suggestions on how else I can verify if the file transferred?

share|improve this question
add comment

1 Answer 1

up vote 0 down vote accepted

enablyPTY() should fix the stdin: is not a tty. You can also suppress stderr in phpseclib with enableQuietMode(). getExitStatus() will return the exit status.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.