I. First, let's look at the following in linux:
Copy codeThe Code is as follows :#! /Bin/bash
Cd/ftp/
CURRENTDATE = 'date + % Y % m % d'
YESTERDAY = 'date-d yesterday + % Y % m % d'
THREEDAYAGO = 'date-d' 3 days ago '+ % Y % m % d'
# Echo $ TWODAYAGO
Ftp-n-I 34.97.34.3 <!
User ftpuser
Bin
Mput $ YESTERDAY .*
Delete $ THREEDAYAGO .*
Bye
!
Note: This script combines the crontab in linux to regularly upload the data file of the previous day to another server and delete the data file of the previous three days!
2. the ftp script in windows is divided into two parts:
1. Execution File
2. Text Files
The execution file suffix is *. bat:
Copy codeThe Code is as follows: @ echo off
Cd/d e: \ siis \ code_tz \
Ftp-I-s: "D: \ ftpscript \ ftp.txt"
Exit
Text file:
Open 200.120.75.229
Ftpuser
Ftpuser
Cd siis
Bin
Mput *
Close
Bye
Note: This script is used in combination with scheduled tasks in windows to regularly update files in a directory of a remote server.