Computing.Net > Forums > Windows XP > Batch file - Scroll threw all files

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Batch file - Scroll threw all files

Reply to Message Icon

Name: korivo
Date: April 8, 2005 at 07:41:25 Pacific
OS: XP
CPU/Ram: Pentium 4 3.00 Ghz / 1 gi
Comment:

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




Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: April 8, 2005 at 08:23:22 Pacific
Reply:

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 bye

ftp -s:ftpget.lst
::**

The put the list into a file and:

::**
@echo off

for /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, etc

M2


If at first you don't succeed, you're about average.


0

Response Number 2
Name: korivo
Date: April 8, 2005 at 11:16:56 Pacific
Reply:

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


0

Response Number 3
Name: Mechanix2Go
Date: April 8, 2005 at 11:33:05 Pacific
Reply:

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.


0

Response Number 4
Name: korivo
Date: April 8, 2005 at 11:37:35 Pacific
Reply:

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


0

Response Number 5
Name: Mechanix2Go
Date: April 8, 2005 at 11:40:19 Pacific
Reply:

Why are you using ftp?

M2


If at first you don't succeed, you're about average.


0

Related Posts

See More



Response Number 6
Name: korivo
Date: April 8, 2005 at 11:42:21 Pacific
Reply:

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


0

Response Number 7
Name: Mechanix2Go
Date: April 8, 2005 at 11:50:00 Pacific
Reply:

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.


0

Response Number 8
Name: korivo
Date: April 8, 2005 at 11:53:24 Pacific
Reply:

I do have access in 'remote desktop'.


0

Response Number 9
Name: Mechanix2Go
Date: April 8, 2005 at 11:59:25 Pacific
Reply:

You're out of my league.

Dunno what remote desktop is.

M2


If at first you don't succeed, you're about average.


0

Response Number 10
Name: oldfogey
Date: April 8, 2005 at 17:35:25 Pacific
Reply:

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.


0

Sponsored Link
Ads by Google
Reply to Message Icon

my winamp wont play .wmv ... hyperlinks are opening bl...



Post Locked

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


Go to Windows XP Forum Home


Sponsored links

Ads by Google


Results for: Batch file - Scroll threw all files

batch file that del all in folder? www.computing.net/answers/windows-xp/batch-file-that-del-all-in-folder/163673.html

simple batch file www.computing.net/answers/windows-xp/simple-batch-file/149160.html

Change prompt with batch file www.computing.net/answers/windows-xp/change-prompt-with-batch-file/147732.html