First, look at the Linux under:
Copy Code code 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 Ftpuser
Bin
Mput $YESTERDAY. *
Delete $THREEDAYAGO. *
Bye
!
Note: This script unifies the Linux under the crontab, timed the day before the data file to another server, and deletes the first 3 days data file!
Two, the FTP script under Windows is divided into 2 parts:
1, the implementation of the document
2. text file
The execution file suffix is *.bat:
Copy Code code 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 combines the scheduled tasks under Windows to periodically update files in a directory on the remote server.