Batch file to synch FTP folder with local

November 21, 2009 at 00:49:25
Specs: Windows XP

I have to download files from unix ftp server to a local directory as and when it is uploaded by my friend. Is there a way I can write MS-DOS batch file to synchronize a folder in the FTP server to a local windows directory? Please help. Thanks in advance.

See More: Batch file to synch FTP folder with local

Report •


#1
November 22, 2009 at 08:29:26
@echo off ftp & setLocal EnableDELAYedExpansion

> ss.ftp echo o mysite.com
>> ss.ftp echo username
>> ss.ftp echo password
>> ss.ftp echo ls *.* remotels.txt
>> ss.ftp echo bye

ftp -s:ss.ftp

> ss.ftp echo o mysite.com
>> ss.ftp echo username
>> ss.ftp echo password
>> ss.ftp echo bin

for /f "tokens=* delims= " %%a in (remotels.txt) do (
if not exist "%%a" (
>> ss.ftp echo get "%%a"
)
)

>> ss.ftp echo bye

ftp -s:ss.ftp

del ss.ftp


=====================================
Helping others achieve escape felicity

M2


Report •
Related Solutions


Ask Question