Forum Moderators: phranque

Message Too Old, No Replies

Needed - Sample .bat File to FTP log files

         

jbgilbert

11:47 pm on Mar 26, 2004 (gmt 0)

10+ Year Member



Does anybody have a sample .bat (for xp system) file that can be used to download via FTP scads of logfiles by different names?

Sure would appreciate it if you could share one.

Thanks,

jbgilbert

11:59 pm on Mar 26, 2004 (gmt 0)

10+ Year Member



anybody?

bakedjake

12:03 am on Mar 27, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Have to know the names of the files and their directories, first.

bill

6:26 am on Mar 27, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I found a bunch here [google.com]. Do you have someting special you need to do?

Mike_Levin

6:17 pm on Mar 28, 2004 (gmt 0)

10+ Year Member



Make a text file that contains your FTP instructions...

OPEN my.ftp.com
mylogin
mypassword
binary
MPUT mylog.rar
BYE

Make a bat file that executes it...

FTP -i -s:C:\script_daily.ftp

Then execute the bat file.

It always helps to zip or rar those huge files before the transfer. That can/should be automated too.

txbakers

11:22 pm on Mar 28, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



funny, I just did this very thing.

The only thing mising from the bat file above is the IP or URL of the FTP server.

put all the commands in the "script.txt" file and the FTP.BAT file need only have one line:

FTP -i -s:C:\script.txt

Of course you have to make sure you are running the FTP.BAT from somewhere where it can execute the ftp.exe program. Mine looks like this:

c:
FTP -s:e:\script.txt 64.40.****.xxx

My ftp.bat is on the E drive so I need to first change the directory to C.

Then, my script is on the E drive as well.

That's all there is to it.

I run it automatically using the Windows job scheduler and I get my files every day.

g1smd

12:04 am on Mar 29, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Remind what the -i switch does again. I don't use that one.

I have used those sort of scripts for quite a long time for repetitive tasks.

.

In the script.001.txt file:

open ftp.site.net
username
pssword
cd /webspace
dir
send c:\mydocu~1\www\site.001\folder\latest.index.htm index.html
dir
close

.

In a shortcut icon:

Target: C:\WINDOWS\FTP.EXE -d -s:c:\mydocu~1\www\site.001\scripts\script.001.txt