The batch process uploads files with the specified attributes (incremental backup) to FTP _dos/bat

Source: Internet
Author: User

How to achieve a directory of several files automatically uploaded FTP upload files only have file attributes, and then FTP uploaded successfully after the successful automatic removal (this machine) just uploaded files of the archive attributes, batch processing can be achieved? Somewhat similar to the feature of incremental backups of files.

@echo off
rem Specifies the FTP user name
set ftpuser=ftpusername
rem Specifies the ftp password
set Ftppass=ftppassword
rem Specify the FTP server address set
ftpip=192.168.0.2
set the local folder directory to upload set
srcfolder=c:/test

dir/b/aa-d>nul 2>nul
if%errorlevel% equ 1 (
 echo No archiving file to FTP
 pause
 goto:eof
)
set ftpfile=%temp% /tempftp.txt
> "%ftpfile%" echo,%ftpuser%
>> "%ftpfile%" echo,%ftppass%
>> "%ftpfile% "Echo Bin
for/f" tokens=* "%%a in (' dir/b/aa-d ') does (
 >>"%ftpfile% "Echo put"%srcfolder%/%%a "
)  C22/>>> "%ftpfile%" echo bye
start ftp-v-i-s: "%ftpfile%"%ftpip% ping-n-127.1>nul
*.*

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.