in reply to Re^11: transfer a file via SFTP
in thread transfer a file via SFTP
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^13: transfer a file via SFTP
by ig (Vicar) on Jul 31, 2009 at 21:32 UTC | |
In your previous post you said that when the destination path was "TEST.txt" the transfer was successful, but when you changed the path to "/sftp/test/TEST.txt" it failed. Given the destination system is Windows, I wonder if the ssh server on your Windows system doesn't accept "/" as a directory separator. Maybe it would work if you specified the path as "\\sftp\\test\\TEST.txt", and maybe you should specify the drive: "C:\\sftp\\test\\TEST.txt". You might try running process monitor on the destination system to see what the ssh server is doing when the file transfer is attempted. I guess you will see it attempt to access some file or folder with a permission error. Maybe you will see that it is not the folder you think it is (e.g. on a different drive). | [reply] |
by cc (Beadle) on Jul 31, 2009 at 23:51 UTC | |
The path to the remote directory is /HOME This is not a problem of a remote server. If I change this script like below, then the file will be sent without problems, but it will be renamed from TEST.txt to NEW.txt. I must send a file with original name. How to change this script now?
greetings cc | [reply] [d/l] |
by ig (Vicar) on Aug 01, 2009 at 05:54 UTC | |
Maybe the following will work for you
You might move setup of the sftp connection outside the loop. You should be able to transfer multiple files over a single connection. The first time though the loop the log file will be moved but in subsequent iterations the move will fail because the log file is no longer in its original location. | [reply] [d/l] |
by cc (Beadle) on Aug 01, 2009 at 13:44 UTC | |
by ig (Vicar) on Aug 02, 2009 at 02:34 UTC | |
| |