Skip to main content

A simple and powerful background task management tool

Project description

RunMan

RunMan 是一个简单而强大的后台任务管理工具,支持运行脚本、查看日志、管理进程等功能。

功能特性

  • 🚀 后台运行脚本:支持 Python 和 Shell 脚本的后台运行
  • 📜 日志管理:自动记录日志,支持实时查看和历史查看
  • 🏷️ 别名管理:自动分配单字母别名,方便快速操作
  • 🔄 任务重启:一键重启任务
  • 👥 多用户支持:支持多用户环境(本地和 Docker)
  • 🎯 进程组管理:kill 时自动终止所有子进程
  • 📝 命令历史:记录最近运行的命令
  • 🔍 任务监控:查看任务状态和运行时间

安装

pip install r-task-manager

Windows/PowerShell 用户注意

PowerShell 默认有一个 r 别名(用于 Invoke-History),会与 r-task-manager 的命令冲突。

临时解决方案(仅当前 PowerShell 窗口有效):

Remove-Item Alias:r

永久解决方案(推荐): 将以下内容添加到 PowerShell 配置文件($PROFILE):

Remove-Item Alias:r -Force -ErrorAction SilentlyContinue

查看配置文件路径:

$PROFILE

如果配置文件不存在,创建它:

if (!(Test-Path -Path $PROFILE)) {
    New-Item -ItemType File -Path $PROFILE -Force
}
notepad $PROFILE

然后在文件中添加 Remove-Item Alias:r -Force -ErrorAction SilentlyContinue 并保存。

使用方法

基本命令

# 查看所有运行中的任务(默认)
r

# 启动 Python 脚本
r script.py

# 启动 Shell 脚本
r script.sh

# 启动脚本并传递参数
r script.py arg1 arg2

# 查看所有任务
r ls

# 终止任务(使用别名)
r kill a

# 查看任务日志
r log a
# 或简写
r l a

# 重启任务
r r a

# 查看任务详情
r watch a
# 或简写
r w a

# 显示命令历史
r a

# 初始化 .bashrc(添加常用别名)
r init

# 调试模式启动脚本
r debug script.py

目录跳转

# 方法1:加载 rcd 函数后使用
eval $(r func)
rcd a

# 方法2:直接使用
eval $(r cd a)

# 方法3:获取路径后跳转
cd $(R_PATH_ONLY=1 r cd a)

配置

RunMan 的配置文件存储在用户主目录下的 .runman 目录:

  • ~/.runman/tasks/ - 任务配置文件
  • ~/.runman/history.json - 命令历史

许可证

MIT License

作者

dreamer

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

r_task_manager-1.0.2.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

r_task_manager-1.0.2-py3-none-any.whl (15.9 kB view details)

Uploaded Python 3

File details

Details for the file r_task_manager-1.0.2.tar.gz.

File metadata

  • Download URL: r_task_manager-1.0.2.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for r_task_manager-1.0.2.tar.gz
Algorithm Hash digest
SHA256 6fbaabd82fe2aaa8e3a8b1abf4d0c6beab2ba0e98570dfac96fe368867e74a17
MD5 6a8762b5f3212ed25c886f2358f5ef7e
BLAKE2b-256 6adeb739c12b9814fd623616772f8921813c437e330cf0966e9e4b2303861bfc

See more details on using hashes here.

File details

Details for the file r_task_manager-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: r_task_manager-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 15.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for r_task_manager-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 14add437cd14f0c4514ac0f93e9badab23b68c3cd3441c8112d0e974bfb94c88
MD5 fd314dc7eafff11ab96fb78742108a93
BLAKE2b-256 7f43c585ad82aca66b46ebd744ae99749b0cc151606c73941554cae5a2dc0b53

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page