468,272 Members | 2,077 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,272 developers. It's quick & easy.

FTP Download Directories Recursively

384 256MB
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?

Expand|Select|Wrap|Line Numbers
  1. @ ECHO OFF
  2. ECHO:
  3. ECHO FTP Backup Script
  4. ECHO =================
  5. ECHO:
  6. SET login_script="c:\...\script.ftp"
  7. for /f "tokens=1-3 delims=/- " %%a in ('date /t') do set XDate=%%a%%b%%c
  8. for /f "tokens=1-2 delims=: " %%a in ('time /t') do set XTime=%%a%%b
  9. CD C:\backups\
  10. IF EXIST %XDate%%XTime% GOTO NODIR
  11. MD %XDate%%XTime%
  12. CD %XDate%%XTime%
  13. FTP -v -i -s:%login_script%
  14.  
  15. :NODIR
  16.  
  17. PAUSE
script.ftp
Expand|Select|Wrap|Line Numbers
  1. open 127.0.0.1
  2. root
  3. root
  4. cd public_html
  5. binary
  6. mget *.*
  7. disconnect
  8. bye
Jun 15 '11 #1
1 2805
ziycon
384 256MB
Anyone have any ideas on where to go next?
Jun 20 '11 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Ruby Tuesday | last post: by
1 post views Thread by Antonio Lopez Arredondo | last post: by
5 posts views Thread by rbt | last post: by
3 posts views Thread by Kamen TOMOV | last post: by
2 posts views Thread by Fabian Steiner | last post: by
3 posts views Thread by misceverything | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by zattat | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.