Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

mwsengstock

File Not Transferring via command line

Good Grief. They changed the directory structure on me without notice. The directory I had been writing to all this time got its name changed. Sorry for the dumb post! :evil:
martin

Re: Command Line SFTP not transferring file.

So what is the problem? The file does not appear in the /Greco/Spinatos folder after the script finishes?

Can you add ls command after the put and post a new log file?
mwsengstock

Command Line SFTP not transferring file.

Using the GUI interface I can easily drag and drop the file to the SFTP site, but the command line does not. It appears ok in the log file, but then again I can't decipher what means, thus the need for help.

Command line I am using:
"c:\program files (x86)\WinSCP\"winscp.com /script=c:\spinatos\spinatos.ftp /log="c:\spinatos\spinatos_log.log" /loglevel=0


Contents of script referenced (spinatos.ftp):
option batch abort
option confirm off
open sftp://USERNAME:PASSWORD@ctuit.brickftp.com
cd Greco/Spinatos/
mput c:\Spinatos\*.txt
close
close


Log file is below.


. 2015-06-23 08:12:28.810 --------------------------------------------------------------------------
. 2015-06-23 08:12:28.810 WinSCP Version 5.7.1 (Build 5235) (OS 6.1.7601 Service Pack 1 - Windows Server 2008 R2 Standard)
. 2015-06-23 08:12:28.810 Configuration: HKCU\Software\Martin Prikryl\WinSCP 2\
. 2015-06-23 08:12:28.810 Log level: Normal
. 2015-06-23 08:12:28.810 Local account: GRECOANDSONS\sausage
. 2015-06-23 08:12:28.810 Working directory: C:\Spinatos
. 2015-06-23 08:12:28.810 Process ID: 2072
. 2015-06-23 08:12:28.810 Command-line: "c:\program files (x86)\WinSCP\WinSCP.exe" /console=571 /consoleinstance=_11224_232 "/script=c:\spinatos\spinatos.ftp" "/log=c:\spinatos\spinatos_log.log" "/loglevel=0"
. 2015-06-23 08:12:28.810 Time zone: Current: GMT-7 (US Mountain Standard Time), No DST
. 2015-06-23 08:12:28.810 Login time: Tuesday, June 23, 2015 8:12:28 AM
. 2015-06-23 08:12:28.810 --------------------------------------------------------------------------
. 2015-06-23 08:12:28.810 Script: Retrospectively logging previous script records:
> 2015-06-23 08:12:28.810 Script: option batch abort
< 2015-06-23 08:12:28.810 Script: batch abort
< 2015-06-23 08:12:28.810 Script: reconnecttime 120
> 2015-06-23 08:12:28.810 Script: option confirm off
< 2015-06-23 08:12:28.810 Script: confirm off
> 2015-06-23 08:12:28.810 Script: open sftp://EDI_Greco:***@ctuit.brickftp.com
. 2015-06-23 08:12:28.810 --------------------------------------------------------------------------
. 2015-06-23 08:12:28.810 Session name: EDI_Greco@ctuit.brickftp.com (Ad-Hoc site)
. 2015-06-23 08:12:28.810 Host name: ctuit.brickftp.com (Port: 22)
. 2015-06-23 08:12:28.810 User name: EDI_Greco (Password: Yes, Key file: No)
. 2015-06-23 08:12:28.810 Tunnel: No
. 2015-06-23 08:12:28.810 Transfer Protocol: SFTP
. 2015-06-23 08:12:28.810 Ping type: -, Ping interval: 30 sec; Timeout: 15 sec
. 2015-06-23 08:12:28.810 Disable Nagle: No
. 2015-06-23 08:12:28.810 Proxy: none
. 2015-06-23 08:12:28.810 Send buffer: 262144
. 2015-06-23 08:12:28.810 SSH protocol version: 2; Compression: No
. 2015-06-23 08:12:28.810 Bypass authentication: No
. 2015-06-23 08:12:28.810 Try agent: Yes; Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: No
. 2015-06-23 08:12:28.810 Ciphers: aes,blowfish,3des,WARN,arcfour,des; Ssh2DES: No
. 2015-06-23 08:12:28.810 KEX: dh-gex-sha1,dh-group14-sha1,dh-group1-sha1,rsa,WARN
. 2015-06-23 08:12:28.810 SSH Bugs: A,A,A,A,A,A,A,A,A,A,A
. 2015-06-23 08:12:28.810 Simple channel: Yes
. 2015-06-23 08:12:28.810 Return code variable: Autodetect; Lookup user groups: A
. 2015-06-23 08:12:28.810 Shell: default
. 2015-06-23 08:12:28.810 EOL: 0, UTF: 2
. 2015-06-23 08:12:28.810 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes
. 2015-06-23 08:12:28.810 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No
. 2015-06-23 08:12:28.810 SFTP Bugs: A,A
. 2015-06-23 08:12:28.810 SFTP Server: default
. 2015-06-23 08:12:28.810 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes
. 2015-06-23 08:12:28.810 Cache directory changes: Yes, Permanent: Yes
. 2015-06-23 08:12:28.810 DST mode: 1
. 2015-06-23 08:12:28.810 --------------------------------------------------------------------------
. 2015-06-23 08:12:28.826 Looking up host "ctuit.brickftp.com"
. 2015-06-23 08:12:28.951 Connecting to 54.209.231.99 port 22
. 2015-06-23 08:12:29.154 Server version: SSH-2.0-SSHD-CORE-0.11.0-1
. 2015-06-23 08:12:29.154 Using SSH protocol version 2
. 2015-06-23 08:12:29.154 We claim version: SSH-2.0-WinSCP_release_5.7.1
. 2015-06-23 08:12:29.248 Doing Diffie-Hellman group exchange
. 2015-06-23 08:12:29.467 Doing Diffie-Hellman key exchange with hash SHA-256
. 2015-06-23 08:12:29.702 Verifying host key dss 0xfd7f53811d751229 52df4a9c2eece4e7 f611b7523cef4400 c31e3f80b6512669 455d402251fb593d 8d58fabfc5f5ba30 f6cb9b556cd7813b 801d346ff26660b7 6b9950a5a49f9fe8 047b1022c24fbba9 d7feb7c61bf83b57 e7c6a8a6150f04fb 83f6d3c51ec30235 54135a169132f675 f3ae2b61d72aeff2 2203199dd14801c7 ,0x9760508f15230bcc b292b982a2eb840b f0581cf5,0xf7e1a085d69b3dde cbbcab5c36b857b9 7994afbbfa3aea82 f9574c0b3d078267 5159578ebad4594f e67107108180b449 167123e84c281613 b7cf09328cc8a6e1 3c167a8b547c8d28 e0a3ae1e2bb3a675 916ea37f0bfa2135 62f1fb627a01243b cca4f1bea8519089 a883dfe15ae59f06 928b665e807b5525 64014c3bfecf492a ,0xbd522bd134f5a60c be76a242116674ab 3edce37b353afd9d 1b5339dc9646915f 8dec7f0cc59ec8f6 00709d3cb1caadaa 259fc88ec45cd3a5 ccd5b89411a7fce7 5f222274c2fb0296 64d305584c235f05 fa85fe9ceeede986 2cd8ae9dcdea21d6 89d95145e1d71a26 9961452edf84b2a7 b211271bcde13dd2 471f53537dec1612 with fingerprint ssh-dss 1024 14:7a:2e:9b:91:ef:d1:86:c3:74:04:27:e4:40:85:d4
. 2015-06-23 08:12:29.702 Host key matches cached key
. 2015-06-23 08:12:29.702 Host key fingerprint is:
. 2015-06-23 08:12:29.702 ssh-dss 1024 14:7a:2e:9b:91:ef:d1:86:c3:74:04:27:e4:40:85:d4
. 2015-06-23 08:12:29.702 Initialised AES-256 SDCTR client->server encryption
. 2015-06-23 08:12:29.702 Initialised HMAC-SHA-256 client->server MAC algorithm
. 2015-06-23 08:12:29.780 Initialised AES-256 SDCTR server->client encryption
. 2015-06-23 08:12:29.780 Initialised HMAC-SHA-256 server->client MAC algorithm
! 2015-06-23 08:12:29.874 Using username "EDI_Greco".
. 2015-06-23 08:12:29.967 Prompt (password, "SSH password", <no instructions>, "&Password: ")
. 2015-06-23 08:12:29.967 Using stored password.
. 2015-06-23 08:12:29.967 Sent password
. 2015-06-23 08:12:30.108 Access granted
. 2015-06-23 08:12:30.108 Opening session as main channel
. 2015-06-23 08:12:30.202 Opened main channel
. 2015-06-23 08:12:30.437 Started a shell/command
. 2015-06-23 08:12:30.437 --------------------------------------------------------------------------
. 2015-06-23 08:12:30.437 Using SFTP protocol.
. 2015-06-23 08:12:30.437 Doing startup conversation with host.
> 2015-06-23 08:12:30.437 Type: SSH_FXP_INIT, Size: 5, Number: -1
< 2015-06-23 08:12:30.546 Type: SSH_FXP_VERSION, Size: 5, Number: -1
. 2015-06-23 08:12:30.546 SFTP version 3 negotiated.
. 2015-06-23 08:12:30.546 We believe the server has signed timestamps bug
. 2015-06-23 08:12:30.546 We will use UTF-8 strings until server sends an invalid UTF-8 string as with SFTP version 3 and older UTF-8 string are not mandatory
. 2015-06-23 08:12:30.546 Getting current directory name.
. 2015-06-23 08:12:30.546 Getting real path for '.'
> 2015-06-23 08:12:30.546 Type: SSH_FXP_REALPATH, Size: 10, Number: 16
< 2015-06-23 08:12:30.702 Type: SSH_FXP_NAME, Size: 77, Number: 16
. 2015-06-23 08:12:30.702 Real path is '/'
. 2015-06-23 08:12:30.702 Startup conversation with host finished.
< 2015-06-23 08:12:30.702 Script: Active session: [1] EDI_Greco@ctuit.brickftp.com
> 2015-06-23 08:12:30.702 Script: cd Greco/Spinatos/
. 2015-06-23 08:12:30.702 Cached directory change via "Greco/Spinatos/" to "/Greco/Spinatos".
. 2015-06-23 08:12:30.702 Getting current directory name.
< 2015-06-23 08:12:30.702 Script: /Greco/Spinatos
> 2015-06-23 08:12:30.702 Script: mput c:\Spinatos\*.txt
. 2015-06-23 08:12:30.702 Copying 1 files/directories to remote directory "/Greco/Spinatos"
. 2015-06-23 08:12:30.702 PrTime: Yes; PrRO: No; Rght: rw-r--r--; PrR: No (No); FnCs: N; RIC: 0100; Resume: S (102400); CalcS: No; Mask:
. 2015-06-23 08:12:30.702 TM: B; ClAr: No; RemEOF: No; RemBOM: No; CPS: 0; NewerOnly: No; InclM: ; ResumeL: 0
. 2015-06-23 08:12:30.702 AscM: *.*html; *.htm; *.txt; *.php; *.php3; *.cgi; *.c; *.cpp; *.h; *.pas; *.bas; *.tex; *.pl; *.js; .htaccess; *.xtml; *.css; *.cfg; *.ini; *.sh; *.xml
. 2015-06-23 08:12:30.702 File: 'c:\Spinatos\Spinatos_Greco_Export.txt' [2015-06-23T06:45:39.822Z] [3710]
. 2015-06-23 08:12:30.702 Copying "c:\Spinatos\Spinatos_Greco_Export.txt" to remote directory started.
. 2015-06-23 08:12:30.702 Binary transfer mode selected.
. 2015-06-23 08:12:30.702 Opening remote file.
> 2015-06-23 08:12:30.702 Type: SSH_FXP_OPEN, Size: 66, Number: 259
< 2015-06-23 08:12:30.890 Type: SSH_FXP_HANDLE, Size: 45, Number: 259
> 2015-06-23 08:12:30.890 Type: SSH_FXP_WRITE, Size: 3767, Number: 774
> 2015-06-23 08:12:30.890 Type: SSH_FXP_CLOSE, Size: 45, Number: 1028
> 2015-06-23 08:12:30.890 Type: SSH_FXP_SETSTAT, Size: 62, Number: 521
< 2015-06-23 08:12:31.031 Type: SSH_FXP_STATUS, Size: 72, Number: 774
< 2015-06-23 08:12:31.328 Type: SSH_FXP_STATUS, Size: 17, Number: 1028
< 2015-06-23 08:12:31.328 Status code: 0
. 2015-06-23 08:12:31.328 Preserving timestamp [2015-06-23T06:45:39.000Z]
< 2015-06-23 08:12:31.328 Type: SSH_FXP_STATUS, Size: 17, Number: 521
< 2015-06-23 08:12:31.328 Status code: 0
. 2015-06-23 08:12:31.328 Transfer done: 'c:\Spinatos\Spinatos_Greco_Export.txt' [3710]
> 2015-06-23 08:12:31.328 Script: close
. 2015-06-23 08:12:31.328 Closing connection.
. 2015-06-23 08:12:31.328 Sending special code: 12
. 2015-06-23 08:12:31.328 Sent EOF message