A tmux-based task scheduling and monitoring tool
Project description
Task Management System
A tmux-based task scheduling and monitoring tool with support for concurrent execution, real-time monitoring, email notifications, and more.
Features
- 🚀 Concurrent Execution: Support for multiple tasks running simultaneously
- 📊 Real-time Monitoring: Real-time task status and output viewing
- 🛠️ Resource Monitoring: CPU, memory, and disk usage monitoring
- 📝 Log Management: Automatic task output and log recording
- 🔧 Configuration Management: Simple configuration file management
- 📧 Email Notifications: Automatic email notifications when tasks complete (requires configuration)
Installation
System Requirements
- Python 3.7+
- tmux (required)
Check tmux
Before installation, ensure tmux is installed on your system:
# Check if tmux is installed
command -v tmux
# If not installed, install tmux first
# Ubuntu/Debian:
sudo apt-get install tmux
# CentOS/RHEL:
sudo yum install tmux
# macOS:
brew install tmux
Quick Installation
# Clone repository
git clone <repository-url>
cd task_manager
# Run installation script
chmod +x install.sh
./install.sh
Manual Installation
# Install Python dependencies
pip install -r requirements.txt
# Install package
pip install -e .
# Initialize configuration
task config init
Install from PyPI
# Install from PyPI
pip install lite-slrum
# Initialize configuration
task config init
Usage
Basic Commands
# Run new task
task run "Task Name" "command to execute"
# List all tasks
task list
# Monitor task output in real-time
task monitor <task_id>
# Stop task
task kill <task_id>
# View task status
task status <task_id>
# View task output
task output <task_id>
# Clean up old tasks
task cleanup
# View help
task -h
Examples
# Run a training task
task run "Model Training" "python train.py --epochs 100"
# Run multiple tasks concurrently
task run "Data Processing" "python process_data.py" &
task run "Feature Extraction" "python extract_features.py" &
# Monitor running tasks
task list --resources
# Monitor specific task
task monitor 00001
# Stop all running tasks
task kill --all
Configuration
Email Notifications
To enable email notifications, you need to configure three files:
1. Email Configuration File
Create ~/.task_manager/config/email_config.json:
{
"enabled": true,
"to_email": "your-email@example.com"
}
2. Google API Credentials
- Go to Google Cloud Console
- Create a new project or select existing one
- Enable Gmail API
- Create OAuth 2.0 credentials
- Download credentials file as
credentials.json - Place it in
~/.task_manager/config/credentials.json
3. Gmail Token
Use the following command to get the token:
# Login via Google API to get token
task config google_api login
Quick Import Method
If you already have the configuration files:
# Import email configuration
task config email ~/my_email_config.json
# Import Gmail token
task config token ~/my_token.json
# Import Google API credentials
task config google_api file ~/credentials.json
Configuration Management
# Initialize configuration files
task config init
# Show current configuration
task config show
# Test email configuration
task config test
# Import email configuration
task config email <config_file>
# Import Gmail token
task config token <token_file>
# Setup Google API credentials
task config google_api file <credentials_file>
# Login via Google API
task config google_api login
Command Reference
Global Options
-h, --help: Show help information-v, --version: Show version information
Commands
task run <name> <command> [priority] [max_retries]
Run new task.
Parameters:
name: Task namecommand: Command to executepriority: Task priority (0-10, default 0)max_retries: Maximum retry count (default 0)
Examples:
task run "Train Model" "python train.py"
task run "Important Task" "python important.py" 10
task run "May Fail" "python unstable.py" 0 3
task list [options]
List all tasks.
Options:
--status <status>: Filter tasks by status--resources: Show system resource usage
Examples:
task list # List all tasks
task list --status running # Show only running tasks
task list --resources # Show tasks and resource info
task kill <task_id> [--force] | task kill --all [--force]
Stop task.
Parameters:
task_id: Task ID to stop--all: Stop all running tasks--force: Force stop task
Examples:
task kill 00001 # Stop task 00001
task kill 00001 --force # Force stop task 00001
task kill --all # Stop all running tasks
task monitor <task_id> [--lines N] [--refresh SECONDS]
Real-time task monitoring.
Parameters:
task_id: Task ID to monitor--lines N: Show last N lines of output (default 50)--refresh S: Refresh interval in seconds (default 2.0)
Examples:
task monitor 00001 # Monitor task 00001
task monitor 00001 --lines 100 # Show last 100 lines
task monitor 00001 --refresh 1.0 # Refresh every second
task status <task_id>
View task status.
Parameters:
task_id: Task ID to view status
Examples:
task status 00001 # View status of task 00001
task output <task_id> [--lines N]
View task output.
Parameters:
task_id: Task ID to view output--lines N: Show last N lines of output (default 50)
Examples:
task output 00001 # View output of task 00001
task output 00001 --lines 100 # Show last 100 lines
task cleanup [hours]
Clean up completed tasks.
Parameters:
hours: Clean up tasks completed more than specified hours ago (default 24)
Examples:
task cleanup # Clean up tasks older than 24 hours
task cleanup 12 # Clean up tasks older than 12 hours
task cleanup 0 # Clean up all completed tasks
task logs <task_id> [lines]
View task logs.
Parameters:
task_id: Task ID to view logslines: Show last N lines of logs (default 100)
Examples:
task logs 00001 # View logs of task 00001
task logs 00001 50 # Show last 50 lines
task email <action>
Email notification management.
Actions:
enable: Enable email notificationsdisable: Disable email notificationsshow: Show current email configurationtest: Test email sending
Examples:
task email enable # Enable email notifications
task email disable # Disable email notifications
task email show # View current configuration
task email test # Send test email
task config <action> [file_path]
Configuration management.
Actions:
init: Initialize configuration filesemail <config_file>: Configure email settingstoken <token_file>: Configure Gmail tokengoogle_api file <creds_file>: Configure Google API credentialsgoogle_api login: Login via Google API to get tokenshow: Show current configurationtest: Test email sending
Examples:
task config init
task config email ~/my_email_config.json
task config token ~/my_token.json
task config google_api file ~/credentials.json
task config google_api login
task config show
Task Status
Tasks can have the following statuses:
pending: Waiting to startrunning: Currently runningcompleted: Successfully completedfailed: Failed to completekilled: Manually stopped
File Structure
~/.task_manager/
├── config/
│ ├── email_config.json # Email configuration
│ ├── credentials.json # Google API credentials
│ └── token.json # Gmail token
├── logs/ # Task log files
│ ├── 00001.log
│ └── 00002.log
└── tasks.json # Task database
Uninstallation
# Run uninstall script
chmod +x uninstall.sh
./uninstall.sh
# Or manually uninstall
pip uninstall lite-slrum
rm -rf ~/.task_manager
Troubleshooting
Common Issues
- tmux not found: Install tmux using your package manager
- Permission denied: Make sure you have execute permissions for scripts
- Email not working: Check Gmail API configuration and token validity
- Task not starting: Check if tmux session name conflicts exist
Log Files
- Task logs:
~/.task_manager/logs/<task_id>.log - System logs: Check terminal output for error messages
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Author
Created by zheng
Changelog
v1.0.3 (2025-09-10)
- Initial release
- Basic task management functionality
- tmux integration
- Email notifications
- Resource monitoring
- Configuration management
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lite_slurm-1.0.3.tar.gz.
File metadata
- Download URL: lite_slurm-1.0.3.tar.gz
- Upload date:
- Size: 23.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aef2b2b77988295d9c3841954c8de1a0d818133bbd2a9d3102eb91f95a805851
|
|
| MD5 |
b8e491d09fec192cdd321ca815d0303c
|
|
| BLAKE2b-256 |
c5c5358bc921e44006df23415bab4a11d1d6d3e2b047275c214ae8feab97e449
|
Provenance
The following attestation bundles were made for lite_slurm-1.0.3.tar.gz:
Publisher:
publish.yml on zz9tf/slurm-like-task-manager
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lite_slurm-1.0.3.tar.gz -
Subject digest:
aef2b2b77988295d9c3841954c8de1a0d818133bbd2a9d3102eb91f95a805851 - Sigstore transparency entry: 496129460
- Sigstore integration time:
-
Permalink:
zz9tf/slurm-like-task-manager@8f03e7fbebe6216f88b7450b5047ddb59667f2a3 -
Branch / Tag:
refs/tags/v1.0.3 - Owner: https://github.com/zz9tf
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8f03e7fbebe6216f88b7450b5047ddb59667f2a3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file lite_slurm-1.0.3-py3-none-any.whl.
File metadata
- Download URL: lite_slurm-1.0.3-py3-none-any.whl
- Upload date:
- Size: 23.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
98d826135247031842fc36c7b098e6129896361aabe642cd62dfbf6883b75b07
|
|
| MD5 |
7b0db8ec67a62718ba4333b31a0e7164
|
|
| BLAKE2b-256 |
cb4064920f40dfe436e55101efbd8e125a9037acea502db4b6771d45fcfa6546
|
Provenance
The following attestation bundles were made for lite_slurm-1.0.3-py3-none-any.whl:
Publisher:
publish.yml on zz9tf/slurm-like-task-manager
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lite_slurm-1.0.3-py3-none-any.whl -
Subject digest:
98d826135247031842fc36c7b098e6129896361aabe642cd62dfbf6883b75b07 - Sigstore transparency entry: 496129478
- Sigstore integration time:
-
Permalink:
zz9tf/slurm-like-task-manager@8f03e7fbebe6216f88b7450b5047ddb59667f2a3 -
Branch / Tag:
refs/tags/v1.0.3 - Owner: https://github.com/zz9tf
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8f03e7fbebe6216f88b7450b5047ddb59667f2a3 -
Trigger Event:
push
-
Statement type: