Post a reply

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

martin

Re: Automatic FTP TLS Scheduled Download help

You cannot insert the /log switch in the middle of the scripting commands.

Also note that with 5.7 and newer, you do not need the "option batch abort" "option confirm off".

The correct syntax is:
"C:\Program Files (x86)\WinSCP\WinSCP.exe" /command "open ""Location""" "get ""\*.zip"" ""E:\Dir1\Dir2\Dir3\""" "exit" /log="E:\Dir1\Dir2\Logs\Winscp.log"
kazukokat93

Automatic FTP TLS Scheduled Download help

Hello,

I am using WINScp to automatically download several .zip files from a third party ftp server. On the scheduled task I have done everything that the guide on this site has told me to do and the log files post this.

. 2015-05-20 15:18:44.963 WinSCP Version 5.7.2 (Build 5316) (OS 6.3.9600 - Windows Server 2012 R2 Standard)
. 2015-05-20 15:18:44.963 Configuration: HKCU\Software\Martin Prikryl\WinSCP 2\
. 2015-05-20 15:18:44.963 Log level: Normal
. 2015-05-20 15:18:44.963 Local account: Comp\Administrator
. 2015-05-20 15:18:44.963 Working directory: C:\Windows\system32
. 2015-05-20 15:18:44.963 Process ID: 9148
. 2015-05-20 15:18:44.963 Command-line: "C:\Program Files (x86)\WinSCP\WinSCP.exe" /command "option batch abort" "option confirm off" /log="E:\Dir1\Dir2\Logs\Winscp.log" "open ""Location""" "get ""\*.zip"" ""E:\Dir1\Dir2\Dir3\""" "exit"
. 2015-05-20 15:18:44.963 Time zone: Current: GMT-6, Standard: GMT-7 (Mountain Standard Time), DST: GMT-6 (Mountain Daylight Time), DST Start: 3/8/2015, DST End: 11/1/2015
. 2015-05-20 15:18:44.963 Login time: Wednesday, May 20, 2015 3:18:44 PM
. 2015-05-20 15:18:44.963 --------------------------------------------------------------------------
. 2015-05-20 15:18:44.963 Script: Retrospectively logging previous script records:
< 2015-05-20 15:18:44.963 Script: Opening session using command-line parameter in scripting is deprecated. Use 'open' command instead.
. 2015-05-20 15:18:44.963 --------------------------------------------------------------------------
. 2015-05-20 15:18:44.963 Session name: open "Location" (Ad-Hoc site)
. 2015-05-20 15:18:44.963 Host name: open "Location" (Port: 22)
. 2015-05-20 15:18:44.963 User name: (Password: No, Key file: No)
. 2015-05-20 15:18:44.963 Tunnel: No
. 2015-05-20 15:18:44.963 Transfer Protocol: SFTP (SCP)
. 2015-05-20 15:18:44.963 Ping type: -, Ping interval: 30 sec; Timeout: 15 sec
. 2015-05-20 15:18:44.963 Disable Nagle: No
. 2015-05-20 15:18:44.963 Proxy: none
. 2015-05-20 15:18:44.963 Send buffer: 262144
. 2015-05-20 15:18:44.963 SSH protocol version: 2; Compression: No
. 2015-05-20 15:18:44.963 Bypass authentication: No
. 2015-05-20 15:18:44.963 Try agent: Yes; Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: No
. 2015-05-20 15:18:44.963 Ciphers: aes,blowfish,3des,WARN,arcfour,des; Ssh2DES: No
. 2015-05-20 15:18:44.963 KEX: dh-gex-sha1,dh-group14-sha1,dh-group1-sha1,rsa,WARN
. 2015-05-20 15:18:44.963 SSH Bugs: A,A,A,A,A,A,A,A,A,A,A
. 2015-05-20 15:18:44.963 Simple channel: Yes
. 2015-05-20 15:18:44.963 Return code variable: Autodetect; Lookup user groups: A
. 2015-05-20 15:18:44.963 Shell: default
. 2015-05-20 15:18:44.963 EOL: 0, UTF: 2
. 2015-05-20 15:18:44.963 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes
. 2015-05-20 15:18:44.963 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No
. 2015-05-20 15:18:44.963 SFTP Bugs: A,A
. 2015-05-20 15:18:44.963 SFTP Server: default
. 2015-05-20 15:18:44.963 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes
. 2015-05-20 15:18:44.963 Cache directory changes: Yes, Permanent: Yes
. 2015-05-20 15:18:44.963 DST mode: 1
. 2015-05-20 15:18:44.963 --------------------------------------------------------------------------
. 2015-05-20 15:18:44.979 Looking up host "open "Location""



Ok. SO most of it looks good of course so I think the issues revolves around my arguments section of it. Below are my arguments.

/command "option batch abort" "option confirm off" /log="E:\Dir1\Dir2\Logs\Winscp.log" "open ""Location""" "get ""\*.zip"" ""E:\Dir1\Dir2\Dir3\""" "exit"


Ok so when I manually use the program to connect to this ftp site I use FTP and a TLS connection. It has my credentials saved under the "Location" name. I have tried using


"open ""ftp://user:password@ftp.location.net/"""


but in the log files it just states Looking up host "open sftp"

Any help here?