Results 1 to 3 of 3

Thread: Need an automated FTP batch process?

  1. #1
    Don't ya like clowns? Paul's Avatar
    Join Date
    Feb 2001
    Age
    44
    Posts
    29,970
    Rep Power
    1059

    Default Need an automated FTP batch process?

    I just wrote a quit batch for something and figured it would make a good tutorial or quick refresher for anyone wanting to know dos commands or how to automate a ftp download/delete in command line. Many FTP clients will allow you to automate downloads using a synch process but it is hard to find one that will automate deletion. I needed to download a daily file and delete it after i was done while being able to log everything. Here you go:

    1) first thing you need to do is create a bat file
    2) open up notepad, add quoted below and save file w/ .bat exentsion to c:\
    3) bat file contains the following
    cd c:\
    ftp -s:ftp.txt mywebsite.com >> c:\ftp_log.log 2>>&1
    cd c:\ = change directory c:\
    ftp = ftp command
    -s:ftp.txt = run this text file
    mywebsite.com = the site i want to ftp into
    >> = needed to separate commands
    c:\ftp_log.log = the file i want to write to; this will allow me to track my process
    2>>%1 = append to file so i can see every time this file runs in one file

    4) create ftp.txt file to hold all of our login credentials(see quoted below) and run commands
    username
    password
    cd inbox
    mget *
    y
    mdelete
    *
    y
    close
    quit
    username = username needed to login
    password = password needed to login
    cd inbox = change directory to location in ftp needed
    mget * = get any file
    y = yes (confirmation)
    mdelete * = delete any file
    y = yes (confirmation)
    close = close connection
    quit = quit bat

    5) Then under Start > Accessories > System Tools > Scheduled tasks you can set the task to run as needed.


    Google FTP Commands if you need to alter anything - Enjoy!
    Paul "your bullshit makes the flowers grow"

  2. #2
    Mountain man green91's Avatar
    Join Date
    May 2003
    Location
    Dahlonega, Ga
    Posts
    8,975
    Rep Power
    44

    Default

    Nice info, may want to throw a binary in there also depending on what type of files are being retrieved.

  3. #3
    Don't ya like clowns? Paul's Avatar
    Join Date
    Feb 2001
    Age
    44
    Posts
    29,970
    Rep Power
    1059

    Default

    Quote Originally Posted by green91
    Nice info, may want to throw a binary in there also depending on what type of files are being retrieved.
    lol - man i racked my brain for a good minute trying to figure out a way to get my client to work and was like mutha fucka i can do this in dos

    its easy to forget how useful command line can be.
    Paul "your bullshit makes the flowers grow"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
ImportAtlanta is a community of gearheads and car enthusiasts. It does not matter what kind of car or bike you drive, IA is an open community for any gearhead. Whether you're looking for advice on a performance build or posting your wheels for sale, you're welcome here!
Announcement
Welcome back to ImportAtlanta. We are currently undergoing many changes, so please report any issues you encounter with the site using the 'Contact Us' button below. Thank you!