-1

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?

snoopy76
  • 305
  • 2
  • 7
  • 15

1 Answers1

0

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

neubert
  • 15,947
  • 24
  • 120
  • 212