471,045 Members | 1,319 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,045 software developers and data experts.

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%
  15. :NODIR
  17. PAUSE
Expand|Select|Wrap|Line Numbers
  1. open
  2. root
  3. root
  4. cd public_html
  5. binary
  6. mget *.*
  7. disconnect
  8. bye
Jun 15 '11 #1
1 2869
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

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.