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

Advertisement

Advertisement

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

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

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

Reply with quote

sp119
Guest

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.

Reply with quote

sp119
Joined:
Posts:
1
Location:
Atlanta, GA

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!

Reply with quote

Advertisement

arun-j
Joined:
Posts:
3

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!!

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum