Computing.Net > Forums > Programming > Batch File FTP commands

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 FTP commands

Reply to Message Icon

Name: darkrain777
Date: January 8, 2008 at 16:07:00 Pacific
OS: XP
CPU/Ram: 512 GB
Product: Compaq
Comment:

Does anyone know if there is anyway after using a batch file to ftp into a server and then using the mput command to have it timeout if it gets stuck on a file transfer and move on to the next file. Also, does anyone know if there is anyway using the mput command to create a log of the files transfered, to see which files are successful and which failed? I have my code done to automatically transfer files, but if the internet connetion fails, I would like to log which files are transfered and timeout if necessary. Thanks anyone for help.



Sponsored Link
Ads by Google

Response Number 1
Name: Razor2.3
Date: January 8, 2008 at 19:38:28 Pacific
Reply:

I've tried various things in the past, but I've never had much success. I hope your search goes better than mine.


0

Response Number 2
Name: Mechanix2Go
Date: January 9, 2008 at 00:17:50 Pacific
Reply:

This will make a log:

::==
@echo off

> ft.do echo o triangle.com
>> ft.do echo user
>> ft.do echo pass
>> ft.do echo bin
>> ft.do echo cd mydir
>> ft.do echo prompt
>> ft.do echo mput *.bat
>> ft.do echo mput *.jpg
>> ft.do echo bye

ftp -s:ft.do > log



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

M2



0

Response Number 3
Name: darkrain777
Date: January 9, 2008 at 14:39:46 Pacific
Reply:

Thanks Mechanix2Go for the log file, that helps a lot I really appreciate it. Do you know if it is possible to have a timeout feature too? I don't even think its possible, but I really thank you for your help.


0

Response Number 4
Name: Mechanix2Go
Date: January 9, 2008 at 23:29:55 Pacific
Reply:

No idea how to provide a timeout.


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

M2



0

Response Number 5
Name: User123456789
Date: January 10, 2008 at 05:45:49 Pacific
Reply:

Launch the script in which you do the FTP, in a seperate DOS-Window, ex.

--------
@echo off

echo This is script...
start FTP-script.cmd

<command that waits for X seconds/minutes/hours>

kill the script called "FTP-script.cmd"
--------


There's ways to have the above wait command not having to be completed, if the FTP-actually completed quickly, but the above will work.

Make the name of the FTP-script as specific as you can, because you will be killing any script with the same name ...

Kill may not be standard Windows ... well, you know the drill, Google = your fiend

Hi there.


0

Related Posts

See More



Response Number 6
Name: darkrain777
Date: January 10, 2008 at 14:23:30 Pacific
Reply:

Yes, I appreciate that idea and it makes sense for killing the whole script. However, I don't need the script to be killed.

I would like a way to skip a file if it can't be uploaded in say 10 seconds and move on to the next file. I've been searching google for a long time too, and it doesn't seem possible. Thanks everyone for your help.


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

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


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Batch File FTP commands

FTP and Batch Files www.computing.net/answers/programming/ftp-and-batch-files/13160.html

Batch File: For Command Syntax www.computing.net/answers/programming/batch-file-for-command-syntax/9262.html

Batch File Commands (HELP PLZ!) # 2 www.computing.net/answers/programming/batch-file-commands-help-plz-2/16085.html