task-manage
一个轻量级的定时任务执行系统,支持python,nodejs,以及一切命令行任务
安装
pip install task-manage
##使用方法
服务启动
sudo tm runserver
服务停止
sudo tm stopserver
查看任务列表
tm ls
添加任务 具体参数查看 tm add --help
tm add --help
Options:
-l, --log PATH 日志文件目录路径 如果为空 不保存日志
-p, --path PATH 执行的文件路径
-i, --info TEXT 任务描述信息
-a, --args TEXT 执行命令时携带的参数 需打双引号
-cmd, --command TEXT cmd命令,需打双引号
-c, --cron TEXT cron表达式,需打双引号 [required]
-n, --name TEXT 任务名称 [required]
-f, --file PATH json配置文件
-cn --commandname TEXT 任务名称
-ld --logbackupday TEXT 日志保存的时间
--help Show this message and exit.
每5秒执行一次 /opt/app/src/test.py
tm add -n test -c "0/5 * * * * * *" -cn python3 -p /opt/app/src/test.py
或者
tm add -n test -c "0/5 * * * * * *" -cmd "python3 /opt/app/src/test.py"
通过配置文件执行,可同时添加多个执行任务 如 tm.json
[
{
"name":"test",
"cron":"0/5 * * * * * *",
"commandName": "python3",
"path":"/opt/app/src/test.py",
"cmd":"",
"args":"",
"logPath":"/opt/app/logs",
"logBackupDay": 7,
"info":"this is a demo"
}
]
tm add -f tm.json
编辑任务 具体参数查看 tm edit --help
tm edit --help
Options:
-l, --log PATH 日志文件目录路径 如果为空 不保存日志
-a, --args TEXT 执行命令时携带的参数 需打双引号
-cmd, --command TEXT cmd命令,需打双引号
-p, --path PATH 执行的文件路径
-i, --info TEXT 任务描述信息
-c, --cron TEXT cron表达式
-n, --name TEXT 任务名称 [required]
-cn --commandname TEXT 任务名称
-ld --logbackupday TEXT 日志保存的时间
--help Show this message and exit.
修改任务的执行时间
tm edit -n test -c "0/10 * * * * * *"
停止任务
tm stop -n test
开始任务
tm start -n test
暂停任务
tm paused -n test
恢复暂停中的任务
tm resume -n test
立即执行任务
tm run -n test
删除任务
tm delete -n test
查看任务日志
tm log -n test
Metadata
Release files for task-manage 1.0.5.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| task-manage-1.0.5.5.tar.gz | 61.4 kB | Without provenance | Details for task-manage-1.0.5.5.tar.gz |
Release files / task-manage-1.0.5.5.tar.gz
| Download URL | task-manage-1.0.5.5.tar.gz |
|---|---|
| Size | 61.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8a6fb8455742d171712a53488f5a1139be0b562604815e1531ce536fa59612ae
|
|
BLAKE2b-256 checksum How to use checksums |
c9f32a220b26aa7f317d38c698d284f9f0313b229f3f4c3ba9bc93ba68657999
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.0.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.7.3
|
Security for task-manage 1.0.5.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.