GithubHelp home page GithubHelp logo

barry-ran / taskscheduler Goto Github PK

View Code? Open in Web Editor NEW
47.0 4.0 14.0 20.16 MB

基于flask和apscheduler的可视化操作任务调度系统,支持一次性任务、定时任务、周期任务。

License: MIT License

Shell 0.01% Python 99.42% ASP.NET 0.01% C# 0.07% Visual Basic .NET 0.06% Classic ASP 0.08% ObjectScript 0.23% Java 0.08% PHP 0.05%
flask apscheduler

taskscheduler's Introduction

基于flask和apscheduler的可视化操作任务调度系统,支持一次性任务、定时任务、周期任务。

基于JobCenter修改

特点:

  • 可视化界面操作
  • 定时任务统一管理
  • 完全兼容Crontab
  • 支持秒级定时任务
  • 作业任务可搜索、暂停、删除
  • 作业任务持久化存储、三种不同触发器类型作业动态添加

用法:

$ git clone [email protected]:barry-ran/TaskScheduler.git
$ cd TaskScheduler
$ pipenv install --dev
$ pipenv shell
# 先在config.py中的mysql_info配置数据库用户名、密码
# 需提前创建数据库(jobs),空数据库即可
$ flask init 

$ flask run
* Running on http://127.0.0.1:5000/

# 开启外网访问
flask run --host 0.0.0.0 --port 5000

常用命令

$ pipenv install  # 创建虚拟环境并安装依赖
$ pipenv shell  # 激活虚拟环境
$ flask initdb  # 初始化数据库
$ flask initdb --drop # 删除数据

介绍

APScheduler工作流程图

清爽的登录界面

内置管理员账户,可直接登录

针对不同触发器动态增加定时任务

例如下面添加了一个每隔60s定时爬取小姐姐图片的python脚本任务(脚本在jobs/crawler_girls.py中)

任务执行输出日志持久化存放并展示

可以在任务输出中查看我们已经爬取到了小姐姐图片地址

任务列表中暂停、恢复已添加定时任务

开发相关

ubuntu安装mariadb

# 安装服务
apt-get install mariadb-server
# 启动
sudo systemctl start mariadb
sudo systemctl enable mariad
# 设置密码(第一次安装密码为空,直接回车即可)
mysql -u root -p
use mysql;
update user set authentication_string=password("123456") where user="root";
flush privileges;

# 设置允许用户密码登录(ubuntu下需要)
UPDATE user SET plugin='mysql_native_password' WHERE User='root';
FLUSH PRIVILEGES;
# 创建数据库
create database jobs;

参考文档: ubuntu18.04下安装mariaDB

MariaDB设置密码

taskscheduler's People

Contributors

barry-ran avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  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.