FTP Download Directories Recursively

Status
Not open for further replies.

ziycon

New Member
I have a script that will connect and download all the files in the root directory but I need to recursively download all sub-directories and their files, there could be sub-directories in sub-directories to the a maximum of 15 I'd say.

I know windows native FTP command doesn't support recursive download with mget but can anyone point me to a good script function that will do what I require or even help me out with the code I have already?

Code:
@ ECHO OFF
ECHO:
ECHO FTP Backup Script
ECHO =================
ECHO:
SET login_script="c:\...\script.ftp"
for /f "tokens=1-3 delims=/- " %%a in ('date /t') do set XDate=%%a%%b%%c
for /f "tokens=1-2 delims=: " %%a in ('time /t') do set XTime=%%a%%b
CD C:\backups\
IF EXIST %XDate%%XTime% GOTO NODIR
MD %XDate%%XTime%
CD %XDate%%XTime%
FTP -v -i -s:%login_script%

:NODIR

PAUSE


script.ftp
Code:
open 127.0.0.1
root
root
cd public_html
binary
mget *.*
disconnect
bye
 

ziycon

New Member
Got it working, a nice little script that will backup the webserver via FTP and the databases which creates a folder based on the date and time of the script executing.
 
Status
Not open for further replies.
Top