Change Directory Failing on File Transfer (works initially though...?)

Advertisement

B Bestvina
Guest

Change Directory Failing on File Transfer (works initially though...?)

I'm having a similar issue that's causing me to tear my hair out! The script changes directories successfully, but when going to move the file, it tries to change directories again and fails! I'm at a loss :/ Here is my script file:

option batch abort
option confirm off

open ftp://[omitted]
cd ..
cd ..
cd infa_shared
cd imatica
cd GSC
cd SRCFiles
put c:\Temp\HIDBadgeCodeToSSO.csv
exit

Here is my log file:

. 2015-05-29 11:26:35.564 --------------------------------------------------------------------------
. 2015-05-29 11:26:35.564 WinSCP Version 5.7.3 (Build 5438) (OS 6.1.7601 Service Pack 1 - Windows 7 Professional)
. 2015-05-29 11:26:35.564 Configuration: HKCU\Software\Martin Prikryl\WinSCP 2\
. 2015-05-29 11:26:35.564 Log level: Normal
. 2015-05-29 11:26:35.564 Local account: [omitted]
. 2015-05-29 11:26:35.564 Working directory: C:\Windows\system32
. 2015-05-29 11:26:35.564 Process ID: 81344
. 2015-05-29 11:26:35.564 Command-line: "C:\Program Files\WinSCP\WinSCP.exe" /console=573 /consoleinstance=_81428_23 "/script=c:\Temp\FTPScript.txt" "/log=c:\Temp\scplog.log"
. 2015-05-29 11:26:35.564 Time zone: Current: GMT-4, Standard: GMT-5 (Eastern Standard Time), DST: GMT-4 (Eastern Daylight Time), DST Start: 3/8/2015, DST End: 11/1/2015
. 2015-05-29 11:26:35.564 Login time: Friday, May 29, 2015 11:26:35 AM
. 2015-05-29 11:26:35.564 --------------------------------------------------------------------------
. 2015-05-29 11:26:35.564 Script: Retrospectively logging previous script records:
> 2015-05-29 11:26:35.564 Script: option batch abort
< 2015-05-29 11:26:35.564 Script: batch abort
< 2015-05-29 11:26:35.564 Script: reconnecttime 120
> 2015-05-29 11:26:35.564 Script: option confirm off
< 2015-05-29 11:26:35.564 Script: confirm off
> 2015-05-29 11:26:35.564 Script: open [omitted]
. 2015-05-29 11:26:35.564 --------------------------------------------------------------------------
. 2015-05-29 11:26:35.564 Session name: [omitted] (Ad-Hoc site)
. 2015-05-29 11:26:35.564 Host name: [omitted] (Port: 21)
. 2015-05-29 11:26:35.564 User name: fungscp (Password: Yes, Key file: No)
. 2015-05-29 11:26:35.564 Transfer Protocol: FTP
. 2015-05-29 11:26:35.564 Ping type: C, Ping interval: 30 sec; Timeout: 15 sec
. 2015-05-29 11:26:35.564 Disable Nagle: No
. 2015-05-29 11:26:35.564 Proxy: none
. 2015-05-29 11:26:35.564 Send buffer: 262144
. 2015-05-29 11:26:35.564 UTF: 2
. 2015-05-29 11:26:35.564 FTP: FTPS: None; Passive: Yes [Force IP: A]; MLSD: A [List all: A]
. 2015-05-29 11:26:35.564 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes
. 2015-05-29 11:26:35.564 Cache directory changes: Yes, Permanent: Yes
. 2015-05-29 11:26:35.564 Timezone offset: 0h 0m
. 2015-05-29 11:26:35.564 --------------------------------------------------------------------------
. 2015-05-29 11:26:35.564 Connecting to [omitted] ...
. 2015-05-29 11:26:35.644 Connected with [omitted]. Waiting for welcome message...
< 2015-05-29 11:26:35.674 220 (vsFTPd 2.0.5)
> 2015-05-29 11:26:35.674 USER fungscp
< 2015-05-29 11:26:35.704 331 Please specify the password.
> 2015-05-29 11:26:35.704 PASS ********
< 2015-05-29 11:26:35.914 230 Login successful.
> 2015-05-29 11:26:35.914 SYST
< 2015-05-29 11:26:35.954 215 UNIX Type: L8
> 2015-05-29 11:26:35.954 FEAT
< 2015-05-29 11:26:35.994 211-Features:
< 2015-05-29 11:26:35.994 EPRT
< 2015-05-29 11:26:36.034 EPSV
< 2015-05-29 11:26:36.034 MDTM
< 2015-05-29 11:26:36.034 PASV
< 2015-05-29 11:26:36.034 REST STREAM
< 2015-05-29 11:26:36.034 SIZE
< 2015-05-29 11:26:36.034 TVFS
< 2015-05-29 11:26:36.034 UTF8
< 2015-05-29 11:26:36.034 211 End
> 2015-05-29 11:26:36.034 OPTS UTF8 ON
< 2015-05-29 11:26:36.074 200 Always in UTF8 mode.
. 2015-05-29 11:26:36.074 Connected
. 2015-05-29 11:26:36.074 --------------------------------------------------------------------------
. 2015-05-29 11:26:36.074 Using FTP protocol.
. 2015-05-29 11:26:36.074 Doing startup conversation with host.
> 2015-05-29 11:26:36.074 PWD
< 2015-05-29 11:26:36.104 257 "/home/fungscp"
. 2015-05-29 11:26:36.104 Getting current directory name.
. 2015-05-29 11:26:36.104 Startup conversation with host finished.
< 2015-05-29 11:26:36.104 Script: Active session: [1] [omitted]
> 2015-05-29 11:26:36.104 Script: cd ..
. 2015-05-29 11:26:36.104 Cached directory change via ".." to "/home".
. 2015-05-29 11:26:36.104 Getting current directory name.
< 2015-05-29 11:26:36.104 Script: /home
> 2015-05-29 11:26:36.104 Script: cd ..
. 2015-05-29 11:26:36.114 Cached directory change via ".." to "/".
. 2015-05-29 11:26:36.114 Getting current directory name.
< 2015-05-29 11:26:36.114 Script: /
> 2015-05-29 11:26:36.114 Script: cd infa_shared
. 2015-05-29 11:26:36.114 Cached directory change via "infa_shared" to "/infa_shared".
. 2015-05-29 11:26:36.114 Getting current directory name.
< 2015-05-29 11:26:36.114 Script: /infa_shared
> 2015-05-29 11:26:36.114 Script: cd imatica
. 2015-05-29 11:26:36.114 Cached directory change via "imatica" to "/infa_shared/imatica".
. 2015-05-29 11:26:36.114 Getting current directory name.
< 2015-05-29 11:26:36.114 Script: /infa_shared/imatica
> 2015-05-29 11:26:36.114 Script: cd GSC
. 2015-05-29 11:26:36.114 Cached directory change via "GSC" to "/infa_shared/imatica/GSC".
. 2015-05-29 11:26:36.114 Getting current directory name.
< 2015-05-29 11:26:36.114 Script: /infa_shared/imatica/GSC
> 2015-05-29 11:26:36.114 Script: cd SRCFiles
. 2015-05-29 11:26:36.114 Cached directory change via "SRCFiles" to "/infa_shared/imatica/GSC/SRCFiles".
. 2015-05-29 11:26:36.114 Getting current directory name.
< 2015-05-29 11:26:36.114 Script: /infa_shared/imatica/GSC/SRCFiles
> 2015-05-29 11:26:36.114 Script: put c:\Temp\HIDBadgeCodeToSSO.csv
. 2015-05-29 11:26:36.114 Copying 1 files/directories to remote directory "/infa_shared/imatica/GSC/SRCFiles"
. 2015-05-29 11:26:36.114 PrTime: Yes; PrRO: No; Rght: rw-r--r--; PrR: No (No); FnCs: N; RIC: 0100; Resume: S (102400); CalcS: No; Mask:
. 2015-05-29 11:26:36.114 TM: B; ClAr: No; RemEOF: No; RemBOM: No; CPS: 0; NewerOnly: No; InclM: ; ResumeL: 0
. 2015-05-29 11:26:36.114 AscM: *.*html; *.htm; *.txt; *.php; *.php3; *.cgi; *.c; *.cpp; *.h; *.pas; *.bas; *.tex; *.pl; *.js; .htaccess; *.xtml; *.css; *.cfg; *.ini; *.sh; *.xml
. 2015-05-29 11:26:36.114 File: 'c:\Temp\HIDBadgeCodeToSSO.csv' [2015-05-29T13:51:39.221Z] [1006524]
. 2015-05-29 11:26:36.114 Copying "c:\Temp\HIDBadgeCodeToSSO.csv" to remote directory started.
. 2015-05-29 11:26:36.114 Binary transfer mode selected.
. 2015-05-29 11:26:36.114 Starting upload of c:\Temp\HIDBadgeCodeToSSO.csv
> 2015-05-29 11:26:36.114 CWD /infa_shared/imatica/GSC/SRCFiles/
< 2015-05-29 11:26:36.144 550 Failed to change directory.
> 2015-05-29 11:26:36.144 CWD /infa_shared/imatica/GSC/
< 2015-05-29 11:26:36.194 250 Directory successfully changed.
> 2015-05-29 11:26:36.194 MKD SRCFiles
< 2015-05-29 11:26:36.234 550 Create directory operation failed.
> 2015-05-29 11:26:36.234 CWD /infa_shared/imatica/GSC/SRCFiles/
< 2015-05-29 11:26:36.284 550 Failed to change directory.
. 2015-05-29 11:26:36.284 Copying files to remote side failed.
* 2015-05-29 11:26:36.284 (ExtException) **Copying files to remote side failed.**
* 2015-05-29 11:26:36.284 Failed to change directory.
. 2015-05-29 11:26:36.284 Asking user:
. 2015-05-29 11:26:36.284 Error transferring file 'c:\Temp\HIDBadgeCodeToSSO.csv'. ("Copying files to remote side failed.","Failed to change directory.")
< 2015-05-29 11:26:36.284 Script: Error transferring file 'c:\Temp\HIDBadgeCodeToSSO.csv'.
< 2015-05-29 11:26:36.284 Script: Copying files to remote side failed.

< 2015-05-29 11:26:36.284 Failed to change directory.
* 2015-05-29 11:26:36.284 (EScpSkipFile) Error transferring file 'c:\Temp\HIDBadgeCodeToSSO.csv'.
* 2015-05-29 11:26:36.284 Copying files to remote side failed.
* 2015-05-29 11:26:36.284 Failed to change directory.
. 2015-05-29 11:26:36.284 Script: Failed
. 2015-05-29 11:26:36.284 Script: Exit code: 1
. 2015-05-29 11:26:36.284 Disconnected from server

Any help would be GREATLY appreciated!!

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,440
Location:
Prague, Czechia

Re: Change Directory Failing on File Transfer (works initially though...?)

It does not change the directory initially. WinSCP remembers the directory from previous runs and does not even try to change it. It does that only once it really needs. And that fails. Does the directory even exist now?

Anyway, you should better avoid using the cache for scripts or even better completely isolate the script run from any configuration (including the caches).
See https://winscp.net/eng/docs/scripting#configuration

Reply with quote

Advertisement

You can post new topics in this forum