Computing.Net > Forums > Programming > FTP Remote Move

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.

FTP Remote Move

Reply to Message Icon

Name: bronzini
Date: November 24, 2008 at 15:14:46 Pacific
OS: ms server 2k3
CPU/Ram: xeon/4gb
Product: dell poweredge
Comment:

I need to automate an FTP transfer. I can copy the files (with a batch file) to my computer. But after I copy the files, I need to move them into a subdirectory on the remote server to show they've been copied. (I have to be careful that other files that may be placed onto the server during the get operation aren't prematurely moved into the subdirectory.)

I am running the FTP command via batch:
ftp -s:ftp.txt

ftp.txt looks like this so far:

open 10.10.10.10
user
password
lcd D:\claims
mget *.*
cd downloaded

Now I need to take all the files I've copied and move them into the subdirectory "downloaded" on the server. Any suggestions?



Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: November 25, 2008 at 03:40:05 Pacific
Reply:

This gets all html and moves 'em to somefolder. Season to taste.

==============================================


:: get some files via ftp then move the got files on server

@echo off
setLocal EnableDelayedExpansion

> ft.do echo o my.com
>> ft.do echo user
>> ft.do echo pass
>> ft.do echo bin
>> ft.do echo prompt
>> ft.do echo mget *.html
>> ft.do echo bye

ftp -s:ft.do > getlog
del ft.do

find "Opening BINARY" < getlog > gotlog

> ft.do echo o my.com
>> ft.do echo user
>> ft.do echo pass
for /f "tokens=8 delims= " %%a in (gotlog) do (
>> ft.do echo rename %%a somefolder/%%a
)
>> ft.do echo bye

ftp -s:ft.do
del ft.do


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

M2


0
Reply to Message Icon

Related Posts

See More







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: FTP Remote Move

inserting word DELETE in a log file www.computing.net/answers/programming/inserting-word-delete-in-a-log-file/17700.html

VB6 FTP Access connection string www.computing.net/answers/programming/vb6-ftp-access-connection-string/13697.html

java ftp access www.computing.net/answers/programming/java-ftp-access/14700.html