Skip to main content

High-throughput parallel file system cleaner

Project description

BeeperPurge 🧹

codecov

High-throughput parallel file system cleaner designed for efficiently eliminating millions of old files as close to simultaneously as possible.

Features

  • 🚀 Parallel processing with multi-threading
  • 🎯 Precision targeting of files by age
  • 🔍 Dry-run mode for operation verification
  • 📝 Kubernetes-friendly JSON logging
  • 🔒 Safe handling of sensitive file systems
  • ⚙️ Configurable age thresholds
  • 🐳 Production-ready container with security best practices

Installation

Using Docker (Recommended)

docker pull ghcr.io/your-username/beeper-purge:latest

# Always verify targets first with dry run
docker run -v /path/to/clean:/data ghcr.io/RiveryIO/beeper-purge:latest \
    /data --dry-run --max-age-hours 36

# Execute purge operation
docker run -v /path/to/clean:/data ghcr.io/RiveryIO/beeper-purge:latest \
    /data --max-age-hours 36

Using pip

pip install beeper-purge

Usage

# Show help
beeperpurge --help

# Reconnaissance (dry run)
beeperpurge /path/to/clean --dry-run --max-age-hours 36

# Execute purge
beeperpurge /path/to/clean --max-age-hours 36 --workers 16

# Show version
beeperpurge --version

Operational Metrics

$ beeperpurge /data --dry-run
{
    "timestamp": "2024-11-02T10:15:30,123",
    "level": "INFO",
    "message": "Starting purge operation",
    "extra_fields": {
        "root_path": "/data",
        "dry_run": true,
        "max_workers": 16
    }
}
...
{
    "timestamp": "2024-11-02T10:15:35,456",
    "level": "INFO",
    "message": "Operation completed",
    "extra_fields": {
        "files_processed": 1000000,
        "files_targeted": 150000,
        "duration_seconds": 5.33,
        "elimination_rate": 187617
    }
}

Safety Protocols

  • 🛡️ Dry-run mode for target verification
  • 🔗 No symlink following
  • 🚨 Comprehensive error handling
  • 👤 Non-root container execution
  • ✅ Extensive test coverage

Performance Specifications

Scalability

  • Efficiently handles millions of files
  • Memory usage scales linearly with worker count
  • I/O optimized operations

Recommended Configurations

  • Standard systems: 8-16 workers
  • High-performance systems: 16-32 workers
  • Adjust based on:
    • Available CPU cores
    • I/O capabilities
    • File system response times

Development

Setup

# Clone repository
git clone https://github.com/RiveryIO/BeeperPurge.git
cd beeperpurge

# Create virtual environment
python -m venv venv
source venv/bin/activate  # or `venv\Scripts\activate` on Windows

# Install development dependencies
pip install -e ".[dev]"

Testing

# Full test suite
pytest

# Coverage analysis
pytest --cov=beeper_purge

# Specific test execution
pytest tests/test_cleaner.py

Container Build

docker build -t beeper-purge .

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/enhancement)
  3. Commit your changes (git commit -m 'Add enhancement')
  4. Push to the branch (git push origin feature/enhancement)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

beeperpurge-1.0.8.tar.gz (10.6 kB view details)

Uploaded Source

Built Distribution

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

beeperpurge-1.0.8-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file beeperpurge-1.0.8.tar.gz.

File metadata

  • Download URL: beeperpurge-1.0.8.tar.gz
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for beeperpurge-1.0.8.tar.gz
Algorithm Hash digest
SHA256 fd5bfb9adcfb2850055b4debb1c4379a569ea4bd364fd72c1f30c54735ac8202
MD5 f93ad9d51d9f001f870d5a4b61af7e44
BLAKE2b-256 eb8b71f54427bb24b284f7c55aa9876eaaef6ff58453c079e166b958917b451f

See more details on using hashes here.

File details

Details for the file beeperpurge-1.0.8-py3-none-any.whl.

File metadata

  • Download URL: beeperpurge-1.0.8-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for beeperpurge-1.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 853c65a832af16ea49a60c96a4daca95a83e2f3f6f6fe17ef5cdc6745d9fa629
MD5 5e3eb3830e27c2ff8dbab500de11b0f4
BLAKE2b-256 57b6bc9fc144918dcd63999f5b7a59950bbded74fc174d81277f7685fdbf91f9

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