SoFunction
Updated on 2025-03-10

Batch uploads files with specified attributes to FTP (incremental backup)

Batch uploads files with specified attributes to FTP (incremental backup)

Updated: July 15, 2014 00:22:28 Submission: mdxy-dxy
This article mainly introduces batch processing upload files with specified attributes to FTP, similar to incremental backup function. Friends who need it can refer to it

How to automatically upload several files in a directory to only upload files with archive attributes when FTP is uploaded, and then automatically clear (native) the archive attributes of the file just uploaded (native) after FTP is uploaded successfully. Can batch processing be implemented? It's a bit similar to the incremental backup of files

@echo off
rem SpecifyFTPusername
set ftpUser=FTPUSERNAME
rem SpecifyFTPpassword
set ftpPass=FTPPASSWORD
rem SpecifyFTPServer address
set ftpIP=192.168.0.2
Set the local folder directory to be uploaded
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%/
>"%FtpFile%" echo,%ftpUser%
>>"%FtpFile%" echo,%ftpPass%
>>"%FtpFile%" echo bin
for /f "tokens=*" %%a in ('dir /b /aa-d') do (
 >>"%FtpFile%" echo put "%SrcFolder%/%%a"
)
>>"%FtpFile%" echo bye
start ftp -v -i -s:"%FtpFile%" %ftpIP%
ping -n 10 127.1>nul
attrib -a *.*
  • bat
  • FTP
  • Upload

Related Articles

  • Show lines with only specified numeric characters

    Show batch processing of rows with only specified numbers, which is convenient and special needs.
    2009-05-05
  • How to set the time to turn off the monitor in win7

    Set the time to turn off the monitor, which can be simply implemented through batch processing. Interested friends can learn about this article
    2013-12-12
  • Batch files that stop and start from oracle and mysql databases

    Whenever the machine starts slowly, you need to query the reason and process it. The following is a batch file for the window service. Friends who need it can refer to it.
    2017-09-09
  • Use batch processing to realize automatic shutdown of computer

    Use batch processing to realize automatic shutdown of the computer...
    2007-02-02
  • Introduction and detailed description of DOS batch script language

    Introduction and detailed description of DOS batch scripting language...
    2007-03-03
  • Change the IE proxy server settings using the bat command line method in Windows

    Batch, also known as batch scripts. As the name suggests, batch processing is to batch processing of an object. The extension of the batch file is bat. Here is a sharing with you through this article to change the IE proxy server settings method using the bat command line in Windows. For those who need it, please refer to it.
    2021-06-06
  • Code to get system time under Dos

    Under dos, you can refer to the implementation code for system time.
    2013-07-07
  • Batch processing to realize Internet cafe archives

    Batch processing to realize Internet cafe archives...
    2006-11-11
  • Batch FOR parameters/F tokens detailed explanation

    tokens=x,y,m-n Extract column implementation code.
    2009-04-04
  • Code to clear traces from your computer using scripts and batch processing

    We know that using the Windows operating system to open files, enter various passwords, or chat with friends with QQ, may cause personal secrets to leak and leave traces on the machine. For safety reasons, if you are on a public computer, you should erase the traces left by these operations when you leave. Below are possible leak points and solutions.
    2008-08-08

Latest Comments