Rule-based file operations engine for Linux
Project description
Flume
A rule-based file operations engine for Linux. Define rules in YAML -- when files matching patterns appear in watched directories, Flume executes actions: move, copy, rename, convert, sync, archive, deduplicate.
Think Hazel for macOS, but CLI-first, config-driven, no AI, no cloud dependency.
Features
- Watch directories for new files/folders via inotify
- Pattern matching with glob and regex support
- Size filtering -- match files by min/max size
- Actions: move, copy, rename, trash, run shell commands, unzip, desktop notifications
- Rule chaining -- output of one action feeds the next
- One-shot or daemon mode -- run once or watch continuously
- Dry-run mode -- preview what would happen without touching anything
- Summary reports -- export dry-run results as text, JSON, or CSV
- Structured logging -- every operation logged with timestamps
- Config validation -- catch errors before they bite
Installation
pip install flume-engine
Or install from source:
git clone https://github.com/mattWoolly/Flume.git
cd Flume
pip install .
Quick Start
Create ~/.config/flume/rules.yaml:
rules:
- name: organize-downloads
watch: ~/Downloads
match:
pattern: "*.pdf"
actions:
- move: ~/Documents/PDFs/
Then run:
# Preview what would happen
flume run --dry-run
# Run once against existing files
flume run
# Or watch continuously for new files
flume watch
Configuration
Rules live in ~/.config/flume/rules.yaml:
rules:
- name: archive-zips
watch: ~/Downloads
match:
pattern: "*.zip"
actions:
- unzip:
dest: ~/Documents/extracted/
- trash-original: true
- name: organize-screenshots
watch: ~/Pictures/Screenshots
match:
pattern: "*.png"
actions:
- rename: "{date:%Y-%m-%d}_{original}"
- move: ~/Pictures/Screenshots/organized/
- name: large-file-alert
watch: ~/Downloads
match:
pattern: "*"
min_size: 1GB
actions:
- notify:
title: "Large download"
body: "File arrived: {name}"
urgency: critical
- name: cleanup-old-logs
watch: /var/log/myapp
match:
pattern: "*.log"
older_than: 30
actions:
- compress:
dest: /var/log/myapp/archive/
- trash-original: true
Running as a Service
Flume ships a systemd user unit in contrib/flume.service. To install it:
# Copy the unit file
mkdir -p ~/.config/systemd/user
cp contrib/flume.service ~/.config/systemd/user/
# Enable and start
systemctl --user daemon-reload
systemctl --user enable flume
systemctl --user start flume
# Check status
systemctl --user status flume
# View logs
journalctl --user -u flume -f
This runs flume watch under your user session. It restarts automatically on
failure and starts on login. Make sure flume is installed to ~/.local/bin
(i.e. pip install --user -e . or pip install -e . in a virtualenv on your
PATH).
To keep it running after logout (on a server, for example):
loginctl enable-linger $USER
Architecture
flume/
cli.py # CLI entry point (click)
config.py # YAML config loading and validation
watcher.py # inotify filesystem watcher
matcher.py # Pattern/rule matching engine
actions/ # Action implementations
move.py
copy.py
rename.py
trash.py
unzip.py
shell.py
notify.py
engine.py # Rule execution engine
log.py # Structured logging
Requirements
- Python 3.10+
- Linux (inotify-based; macOS/BSD support planned)
License
MIT
Project details
Release history Release notifications | RSS feed
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 flume_engine-1.0.1.tar.gz.
File metadata
- Download URL: flume_engine-1.0.1.tar.gz
- Upload date:
- Size: 45.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 |
5d22883dbe0b603cf1ba638e587e233a93b92e3c75579a1bcc7fa419cb9acc60
|
|
| MD5 |
ba0f0cbbe14de2c9f93bd0e97742c174
|
|
| BLAKE2b-256 |
f3072ec4f46d80599978138ec72f2abbe6e5abfc41d58904fb73de901ab9b159
|
Provenance
The following attestation bundles were made for flume_engine-1.0.1.tar.gz:
Publisher:
publish.yml on mattWoolly/Flume
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
flume_engine-1.0.1.tar.gz -
Subject digest:
5d22883dbe0b603cf1ba638e587e233a93b92e3c75579a1bcc7fa419cb9acc60 - Sigstore transparency entry: 1237452038
- Sigstore integration time:
-
Permalink:
mattWoolly/Flume@ff538b864f32ceb5b77c61e8c1752de49c944b59 -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/mattWoolly
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ff538b864f32ceb5b77c61e8c1752de49c944b59 -
Trigger Event:
push
-
Statement type:
File details
Details for the file flume_engine-1.0.1-py3-none-any.whl.
File metadata
- Download URL: flume_engine-1.0.1-py3-none-any.whl
- Upload date:
- Size: 29.0 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 |
c705dc19a598e0d87a22194ff030292164b4fb03da91fb9e3b2352a3c29d16cf
|
|
| MD5 |
0f1a9a7fde920773538a965a715f1e46
|
|
| BLAKE2b-256 |
1a939187a518a34a06e117c6532ce9758bcadc4d5b72a5d032aae793c045eb8a
|
Provenance
The following attestation bundles were made for flume_engine-1.0.1-py3-none-any.whl:
Publisher:
publish.yml on mattWoolly/Flume
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
flume_engine-1.0.1-py3-none-any.whl -
Subject digest:
c705dc19a598e0d87a22194ff030292164b4fb03da91fb9e3b2352a3c29d16cf - Sigstore transparency entry: 1237452089
- Sigstore integration time:
-
Permalink:
mattWoolly/Flume@ff538b864f32ceb5b77c61e8c1752de49c944b59 -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/mattWoolly
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ff538b864f32ceb5b77c61e8c1752de49c944b59 -
Trigger Event:
push
-
Statement type: