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

arun-j

works now

thanks man it works now... prob was the version
martin

Are you using the latest version of WinSCP?
arun-j

commandline :
"c:\Program Files\WinSCP\WinSCP.exe" /script=C:\appu\testscript.txt /xmllog=C:\appu\apputest.xml
arun-j

Hi,
Im having the same issue ... my log file looks the same ....

if i try /xmllog in the commandline my log file is not written with log data :(

pls help!!
sp119

Re: Can't make the download most recent file work for me

martin wrote:

What does the XML log file look like?


The first part shows the connection information, access granted etc... The bottom part looks like this:



. 2010-12-14 14:15:59.825 --------------------------------------------------------------------------

. 2010-12-14 14:15:59.825 Using SFTP protocol.
. 2010-12-14 14:15:59.825 Doing startup conversation with host.
> 2010-12-14 14:15:59.825 Type: SSH_FXP_INIT, Size: 5, Number: -1
< 2010-12-14 14:15:59.918 Type: SSH_FXP_VERSION, Size: 5, Number: -1
. 2010-12-14 14:15:59.918 SFTP version 3 negotiated.
. 2010-12-14 14:15:59.918 We believe the server has signed timestamps bug
. 2010-12-14 14:15:59.918 We will use UTF-8 strings for status messages only
. 2010-12-14 14:15:59.918 Getting current directory name.
. 2010-12-14 14:15:59.918 Getting real path for '.'
> 2010-12-14 14:15:59.918 Type: SSH_FXP_REALPATH, Size: 10, Number: 16
< 2010-12-14 14:16:00.027 Type: SSH_FXP_NAME, Size: 51, Number: 16
. 2010-12-14 14:16:00.027 Real path is '/'
. 2010-12-14 14:16:00.027 Startup conversation with host finished.
. 2010-12-14 14:16:00.027 Listing directory "/xxxxxx".
> 2010-12-14 14:16:00.027 Type: SSH_FXP_OPENDIR, Size: 17, Number: 267
< 2010-12-14 14:16:00.215 Type: SSH_FXP_HANDLE, Size: 16, Number: 267
> 2010-12-14 14:16:00.230 Type: SSH_FXP_READDIR, Size: 16, Number: 524
< 2010-12-14 14:16:02.835 Type: SSH_FXP_NAME, Size: 9417, Number: 524
> 2010-12-14 14:16:02.835 Type: SSH_FXP_READDIR, Size: 16, Number: 780
< 2010-12-14 14:16:02.929 Type: SSH_FXP_STATUS, Size: 17, Number: 780
< 2010-12-14 14:16:02.929 Status/error code: 1
> 2010-12-14 14:16:02.929 Type: SSH_FXP_CLOSE, Size: 16, Number: 1028
. 2010-12-14 14:16:02.929 Closing connection.
. 2010-12-14 14:16:02.945 Sending special code: 12
. 2010-12-14 14:16:02.945 Sent EOF message


There appears to be an error code of 1 but I don't know what that means.

P.S. Sorry it took so long to get back to this, I've had other projects that took over my life!
martin

Re: Can't make the download most recent file work for me

What does the XML log file look like?
sp119

Can't make the download most recent file work for me

I'm pretty new to scripting so bear with me on this.

I can only get so far with this script. I am able to get it to login, view the files, create the XML file but then it says "No file found" even after it lists the files. I have a mask set to locate a file that starts with a specific name, it lists all the files that start with that but then doesn't go on to actually download anything.

It appears that while it is able to list the files, it doesn't actually write them to the xml file thus the no file in the log if statement that states:

if (filenameLatest == null)
{WScript.Echo("no file found");
WScript.Quit(0);
}

takes affect and doesn't move on to the rest of the script that actually does the file downloading.

Any assistance in pointing me in the write direction would be helpful.
martin

Re: modify 'download most recent file' script to append file?

Add -append switch to get command. It works with SFTP protocol only though.
ardz

modify 'download most recent file' script to append file?

been playing with this fantastic script:

https://winscp.net/eng/docs/script_download_most_recent_file

it's great! but where do I modify it so it automatically appends to a previously downloaded file? (just exits with an error by default if a previously downloaded file already exists). Cheers! :D