ftp remote timing backup, ftp remote timing backup file method and environment configuration

IIS7 server management tool-
FTP client as an FTP client, it supports batch management of FTP site
specific functions:
FTP timed upload and timed download, FTP timed backup, and simple operation
iis7 server management tool or vnc client
supports batch management and management of windows and Linux server and vps
make the server truly one-stop management, which is really very convenient.

Official website portal: fwqglgj.iis7.net/cp/ftp/?tscd-zc

Configuration method:

1. Select the ftp window and click FTP settings

2. After entering "FTP Settings"-"Task Settings", let's add tasks first

1. Create a new task (a task can only choose one time period)

1-1: How to set up a day-level scheduled upload or download task

image

1-2: How to set weekly upload or download tasks

image

1-3: How to set up monthly upload or download tasks

image

Note: the choice of backup type

Append: New file.

Modification: New file, or file with modified content.

Overwrite: Overwrite the original file without comparing the file. (Not recommended)

2. Next, choose FTP (the following example timing upload operation tutorial)

2-1: Click "Select FTP"

image

2-2: Enter the FTP binding interface

image

2-3: Successfully bind a ftp site

image

2-4: ftp binding information and task execution results will be displayed at the bottom of the setting interface

image

3. After prompting that the task upload is successful, we go to the corresponding ftp server to check whether the task upload is completed

After checking, the file has been successfully uploaded!

image

Note: This article takes upload as an example, if you need to download, just change the transmission direction to "download"!

The java configuration method is as follows:

import com.enterprisedt.net.ftp.*;
public class FtpClient {
static FTPClient ftpClient;
public FtpClient(){};
String remoteAddress="192.168.168.33",userName="cattsoft",password="cattsoft";
public void DownLoad(){
try{
FTPClient client = new FTPClient();
client.setRemoteHost(remoteAddress);
client.connect();
client.login(userName,password);
client.setType(FTPTransferType.BINARY);
client.get("E:uploadindex.jsp","/home/cattsoft/jakarta-tomcat-5.0.28/webapps/vip/dkf/index2.jsp");
client.quit();
System.out.println("下载成功...");
}catch(Exception e){
e.printStackTrace();
System.out.println("下载失败...");
}
}
public static void main(String[] args){
FtpClient fc = new FtpClient();
fc.DownLoad();
}
}
Configure connection FTP under java:
public void putTxtToFTP() {
System.out.println("Start execution timer Task: Maintain one-click order volume!");
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.DATE, -1); //Get the previous day's
Date date = calendar.getTime();
SimpleDateFormat df = new SimpleDateFormat("yyyyMMdd");
String yesterday = df.format(date);
StringBuffer yjtjOrderTxt = new StringBuffer();
yjtjOrderTxt.append("yjtywx_").append(yesterday).append(".txt");
List<WxActiveData > yjtjOrderList = activeDataService.wxGetYjtjOrder();
//FtpUtil ftpUtil = new FtpUtil("hexin","hx105155","134.64.105.155", "/yjtydd");  //测试库FTP
FtpUtil ftpUtil = new FtpUtil("ahftp","ahdx@#$_123dic","192.168.0.28", "/yjtydd");
PrintWriter printWriter = null;
File highFeeFile = new File(Contants.FILE_PATH_BAK + yjtjOrderTxt);//Contants.FILE_PATH_BAK = "/opt/wss/domains/tmp/"
//      File highFeeFile = new File("D:/" + highFeeTxt);
//      File gjmyFile = new File("D:/" + gjmyTxt);
//File highFeeFile = new File("D:/" + yjtjOrderTxt);
try {
printWriter = new PrintWriter(new FileWriter(highFeeFile, true));
for (int i = 0; i < yjtjOrderList.size(); i++){
printWriter.println(yjtjOrderList.get(i).toString().trim());
}
} catch (IOException e) {
System.out.println("Active service high data report task is abnormal!");
}finally{
printWriter.close();
}
if(highFeeFile.exists()){
System.out.println("Active service timer task High amount data upload successfully"+yjtjOrderTxt.toString());
ftpUtil.uploadFile(highFeeFile, yjtjOrderTxt.toString());
}else{
System.out.println("Active service timer task high amount data upload failed"+yjtjOrderTxt .toString());
}
System.out.println("Server Batch Check Ranking-Query Results");
}
public ActiveDataService getActiveDataService() {
return activeDataService;
}
public void setActiveDataService(ActiveDataService activeDataService) {
this.activeDataService = activeDataService;
}​

Guess you like

Origin blog.51cto.com/14819671/2540310