Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Im downloading files from a FTP server via a batch file.
Im trying to scroll threw all the files available and download only the files that were created today.Any way to do that in a batch file?
Thanx

Well, first you need to get the list of all files with a BAT like this:
::**
@echo off> ftpget.lst echo o site.com
>> ftpget.lst echo username
>> ftpget.lst echo password
>> ftpget.lst echo bin
>> ftpget.lst echo cd dirname
>> ftpget.lst echo dir
>> ftpget.lst echo byeftp -s:ftpget.lst
::**The put the list into a file and:
::**
@echo offfor /f "tokens=6-9" %%T in (1line) do echo %%T %%U %%V %%W >> 1line.log
::**
Then grep of find the lines containing today's date, etcM2
If at first you don't succeed, you're about average.

Thanx for the replay M2
The list display de file in the prompt command, but its not written in the ftpget.lst.
Only the parameter to open the ftp connection a written to the ftpget.lst.
How can i write the content of the directory to a file?
Thanx

If the list is fairly short and doesn't scroll of the screen, you can click and drag from upper left to lower right and press enter.
That send it to the clipboard.
Then you can paste it into a file.
If the list is too long you'll probably need to ZIP, TAR or CAT it on the server.
That's not something I know much about.
HTH
M2
If at first you don't succeed, you're about average.

I see,
But I needed to be automated! :-)
My problem is that im doiing a backup of file on my server.
The backup itself is about 300 meg, and its growing everyday.
So the batch file start at nite and backup everything.
So thats why i was looking for a solution to backup only the new file, and it needs to be automated.
Let me know if you have any leads on that!
Thanx

Because i need to backup the file somewhere else 'physically' and the server is not located at my workplace, not the same network.

OK,
Since it's your server, can you telnet in and zip up a file list?
M2
If at first you don't succeed, you're about average.

You're out of my league.
Dunno what remote desktop is.
M2
If at first you don't succeed, you're about average.

I may be completely wrng here, as I've never used Remote Desktop, but does it enable you to see the server as a disk drive, not via ftp? Either with a drive letter mapping, or in the form \\server\driveid\filename?
If so you could use the xcopy command, with parameters to copy files if local has a later datestamp than server.eg c:\windows\system32\xcopy c:\data\*.* \\Server\driveid\data /s/e/d/y
just a thought - this is what I use on my p2p net.

![]() |
my winamp wont play .wmv ...
|
hyperlinks are opening bl...
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |