There was a distributed task dispatch center XXL-JOB before, which is also an open source product, so which one is more suitable for you?
Project Introduction
1. Web interface to manage scheduled tasks
2. crontab time expression, accurate to the second
3. If the task fails to be executed, you can try again
4. The task execution times out and is forcibly terminated
5. Tasks are configured in dependencies and executed in queue mode
6. Support shell task and multi-node operation, support Http task, scheduler execution
7. Support task log query
8. You can choose to notify the task execution result in a variety of ways
Supported platforms: Windows, Linux, Mac OS
Install: Click Download
Install the Go environment, mysql
go get -d github.com/ouqiang/gocron
export GO111MODULE=on
Compile make
initiate
gocron ./bin/gocron web
gocron-node ./bin/gocron-node
docker
docker run –name gocron –link mysql:db -p 5920:5920 -d ouqg/gocron
Configuration: /app/conf/app.ini
Logs: /app/log/cron.log
The image does not contain gocron-node, and gocron-node needs to be built together with specific services
Note: When installing, you need to download gocron and gocron-node, gocron is a web configuration platform, and gocron-node is a program deployed by the node that needs to perform tasks
Root is not allowed to execute gocron-node, so specifying a user is sufficient
Use commands
gocron -v to see the version
gocron web -p specifies the port, default is 5920
gocron web -e specifies the runtime environment, dev|test|prod, default prod
gocron web -h to see help
gocron-node -s ip:port listener address
gocron-node -enable-tls enables TLS
gocron-node -ca-file CA certificate file
gocron-node -cert-file certificate file
gocron-node -key-file private key file
X
XL-JOB
Compared with XXL-JOB, the functions of the two are basically the same, gocron is still a little worse for the operation of task batches, task grouping, and multi-user permission control, but the basic use is still completely sufficient.