Git Product home page Git Product logo

autoupdate's Introduction

AutoUpdate

介绍

目的是打造一个可以在程序中直接可以控制多服务器文件的更新、上传、下载、启动脚本的插件

1、上传:完成

2、下载:完成

3、执行脚本:完成

4、定时执行:待开发

5、其他功能:待开发

软件架构

项目是使用纯Java写的,使用统一接口,易扩展,无耦合

文件可选配置:

        /**本地文件存放路径*/
	private String papersPath;
	/**网络文件路径*/
	private String netPapersPath;
	/**服务器存储文件路径*/
	private String depositaryPath;
	/**文件名*/
	private String papersName;
	/**Shell名*/
	private String shellName;
	/**是否备份*/
	private boolean backblaze;
	/**文件是否执行*/
	private boolean runPapers;
	/**是否执行*/
	private boolean run;
	/**是否关闭正在运行的程序*/
	private boolean kill;
	/**是否是从net获取*/
	private boolean wget;
	/**Shell超时时间*/
	private long shellTimeOut;

安装教程

不需要安装,纯Java项目

使用说明

现在有三种实现方式

  1. ShellPushPapers:生成脚本、上传、执行
static SftpConnParam connParam = new SftpConnParam.Builder().host("127.0.0.1").port(22)
			.user("root").password("123456").build();
	static SftpFileParam papersParma = 
			new SftpFileParam.Builder().
			papersPath("F:\\A_01_test\\")
			.depositaryPath("/data/").papersName("test.sh")
			.netPapersPath("http://www.wangchunlong.cn/attachment/20200408/e6cd1f0e8e9d424cbb2f8b1ff7001e97.jpg")
			.run(true).backblaze(true).wget(true).shellTimeOut(3000)
			.build();
	
	public static void main(String[] args) throws JSchException, IOException {
		
                TaskResult<?> pullPapers = new PapersOperatAchieve().executeOperat(new ShellPushPapers(connParam, papersParma));
	}
  1. LocalPushPapers:将本地文件上传至服务器

TaskResult<?> pullPapers = new PapersOperatAchieve().executeOperat(new LocalPushPapers(connParam, papersParma));

  1. LocalPullPapers:将服务器文件拉取至本地

TaskResult<?> pullPapers = new PapersOperatAchieve().executeOperat(new LocalPullPapers(connParam, papersParma));

示例参考测试类

参与贡献

  1. Fork 本仓库
  2. 新建 Feat_xxx 分支
  3. 提交代码
  4. 新建 Pull Request

autoupdate's People

Contributors

p19971018 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.