2

I'm trying to use psftp for a nightly sftp upload but I found out that it hangs. Does anyone have any experience with what may cause such hangs? The psftp can stay in this state for days at end. I tried adding -bc and -be to the start up, it already had -batch.

7 Answers 7

2

I assume you are using scheduled tasks to run this nightly?

Open a command prompt (use runas /user:[email protected] cmd if the task runs with credentials other than your own), then attempt to run the command that you have scheduled. If you are using the -batch parameter, remove it for troubleshooting purposes.

Does the command run properly?

I recently had a similar issue with pscp, it got stuck in a "Running" state because the account the scheduled task was configured to use had not connected to the specific server before and pscp generated the normal "The server's host key is not cached in the registry." prompt and was waiting for confirmation. Using the -batch parameter conceals this prompt. Once I had accepted the prompt once, it ran perfectly, even with -batch.

0

What is it connecting to? We have recently had some issues connecting to VMWare servers although other network traffic works fine. The transfers will stall out after 100-200K of data. We have also had issues in the past where a transfer would finish, but the server would not end the connection. Adding a quit statement to the batch scripts fixed that issue.

1
  • Actually I don't know what's on the other end of the pipe. I'll try adding the quit and see if it makes any difference Jun 8, 2009 at 16:27
0

It's also possible that there's a server configuration or connectivity issue. You can test this by using the -v (verbose) flag on the transfer as noted in section 3.8.3.3 of the putty manual. Look for any error messages or warnings, and post them in your question.

0

If you transfering just only one (or few) files (usually that's true for backups) you can try using pscp instead of pftp - scp is older and simpler protocol, and it uses different SSH subsystem - so less points of failure.

Here is wikipedia links to this protocols if you are interesting:

0

If you are uploading using secure ftp behind a NAT firewall, or any other NAT device, you will be able to connect/authenticate, but won't be able to upload, list director contents, etc, without first modifying the firewall/NAT rules.

Check http://www.lancerobinson.net/archive/2005/08/23/50912.aspx for more info.

0

Sometimes servers try doing a reverse DNS lookup on your address, so if you're connecting from behind a firewall there will be a 30s+ delay in connecting. This often causes SFTP to timeout. We change the timeout to 60 or 120 when connecting to third parties, which almost always fixes the problem.

0

add the options to save the stardard error output (-RedirectStandardError) to the psftp options. It will shed light on the error.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .