Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

FTP Download Directories Recursively

  • 17-06-2011 3:23pm
    #1
    Registered Users, Registered Users 2 Posts: 1,991 ✭✭✭


    I have a BAT 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?
    @ 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
    open 127.0.0.1
    root
    root
    cd public_html
    binary
    mget *.*
    disconnect
    bye
    


Comments

Advertisement