Topic review

I am trying to do the same thing but problem is I need to have during the week 1 file and oon the weekend I need 3 files.

I need to have them by timestamp so easier to get by date. What would the code look like.

Also I am using
C:\Program Files\WinSCP\WinSCP.com Logininfo /script=C:\Downloads\myscript.txt

I would like to add more to the script or make a new script similar to what i am using ( basic get statement ). That file on the ftp are .gz and need to converted in excel or csv format.

sunn

2011-07-04 20:15

I am trying to do the same thing but problem is I need to have during the week 1 file and oon the weekend I need 3 files.

I need to have them by timestamp so easier to get by date. What would the code look like.

LeonPix

2006-08-16 08:23

thx! it's an inspiring answer :)

martin

Re: How to get latest modified file?

2006-08-15

I do not see any nice solution. One of the ugly ways that come to my mind is:

# make copy of the latest file with unique extension,
# so that it can be grabbed by file mask
# (note that you can make the copy in /tmp if needed)
call cp `ls -t | head -1` `ls -t | head -1`.latest
# download the copy, but strip the extension
get *.latest *.
# remove the copy
rm *.latest

LeonPix

Re: How to get latest modified file?

2006-08-15 11:10

Let's say after we connect to a remote sftp site. By doing "ll" we got this: