tags:

views:

409

answers:

2

I am uploading a file via sftp from one server to another server. Normally i will get exit status 0 to indicate the transfer is success.

But there are some instances where i will get exit status 1.

Why is this so? How do i base on this exit status to know what exactly went wrong?

A: 

Surely something must be written to stdout or stderr... are you certain you're not redirecting stdout to /dev/null?

Jaka Jančar
I don't really understand this. Mind to elaborate further?
Non-zero status means that an error has occurred. I'm saying that sftp almost certainly writes what it was somewhere. Can you post the exact command you're running? Does the file actually get uploaded okay?
Jaka Jančar
A: 

What SFTP client are you using? Normally you will be able to switch on verbose logging to figure out what the problem is.

Bruce Blackshaw