Bulk download of files on FTP

Source: Internet
Author: User

Store terminal every day through the front-end sales system to send sales data to the company's designated FTP server. Although you can use the client software to bulk download files from FTP, but this kind of software basically need to operate manually, which for our company's situation, every moment there will be store sales data upload, so that the manual download is too annoying cable. So I thought of the method of downloading a file in a specified time period with batch processing combined with a scheduled task.

First, create a new text file, named "FTPDownloadFiles.txt", as follows:

User name for username//ftp

Password//ftp's password

CD Data/day//FTP path where the file is located, no "/" in front of the first directory

Prompt//download file does not download confirmation prompt

Mget *//download All files in the specified directory

Mdelete * *//delete all files after download is complete

Quit//Exit FTP status

All of the reasons for using Mget and Mdelete are that the get and delete two commands only download a single file and need to specify a certain file name, you cannot use wildcards, and if you do not use prompt, you need to be sure to download each file when you download it.

Then, create a new text file named "Ftpdownload.bat" with the following contents:

echo off
Ftp-s:d:\ My Documents \ Batch command \ftpdownloadfiles.txt 127.0.0.1//The 127.0.0.1 can be replaced with the IP address or domain name of the FTP server; "FTPDownloadFiles.txt" Before you need to add the path of the file, where you need to change the file path; "-S" means to execute the FTP command in the text file sequentially

D://Due to the use of batch commands, the files on the FTP server are all downloaded to the batch folder, so the downloaded files need to be moved to the specified folder, where the specified folder is C:\POS

CD My Documents

CD Batch processing command

Copy *.zip C:\pos//Because all the files in the store are zip files, just copy the files here, and of course you can use the wildcard characters *. * To copy all the files in the past.

Del *.zip//Copy all files need to be deleted

echo on

Exit

Once saved, the batch file is finished. The next step is to add the batch file to the scheduled task and execute it every once in a while. My own settings are downloaded once in 30 minutes.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.