A file change monitor that pushes notifications via WeChat
Project description
wxwatcher
文件变更监控工具,检测到变化时通过微信推送通知。
安装
pip install wxwatcher
用法
监控当前目录
wxwatcher
监控指定目录
wxwatcher /path/to/watch
完整选项
wxwatcher /data \
--interval 10 \
--push-url https://your-api.com/push \
--to-user @all \
--max-batch 50 \
--log-file /tmp/wxwatcher.log
环境变量
所有配置均可通过环境变量设置(优先级低于 CLI 参数):
| 变量 | 说明 | 默认值 |
|---|---|---|
WXWATCHER_DIR |
监控目录 | 当前目录 |
WXWATCHER_INTERVAL |
轮询间隔(秒) | 30 |
WXWATCHER_PUSH_URL |
推送 API 地址 | https://api.yuangs.cc/weixinpush |
WXWATCHER_TO_USER |
接收人 | @all |
WXWATCHER_MAX_BATCH |
单批最大变更数 | 50 |
WXWATCHER_LOG_FILE |
日志文件路径 | ~/.wxwatcher/file_watcher.log |
WXWATCHER_IGNORE |
额外忽略模式(逗号分隔) | 无 |
WXWATCHER_EXT |
仅监控扩展名(逗号分隔) | 全部 |
export WXWATCHER_DIR=/data
export WXWATCHER_INTERVAL=10
wxwatcher
特性
- 两阶段 hash:先 stat 快速扫描,仅疑似变化文件才计算 sha256
- 忽略规则:自动跳过
.git、__pycache__、.venv等 - 分批推送:大量变更时自动分批,避免消息过长
- 配置灵活:CLI 参数、环境变量、默认值三层优先级
日志
默认日志位置:~/.wxwatcher/file_watcher.log
License
MIT
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 wxwatcher-0.1.0.tar.gz.
File metadata
- Download URL: wxwatcher-0.1.0.tar.gz
- Upload date:
- Size: 8.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
74f89094e2130806f3f204a54c35e6ffb5a0fc3ef6e27e664417ceecd18fb3ea
|
|
| MD5 |
cba239462cb50778c9331932bb63cd1d
|
|
| BLAKE2b-256 |
ec3044c5b867bad10d1b5ee9b528dfe21621811f409463320157e418bc36a9b6
|
Provenance
The following attestation bundles were made for wxwatcher-0.1.0.tar.gz:
Publisher:
publish.yml on yuanguangshan/wxwatcher
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wxwatcher-0.1.0.tar.gz -
Subject digest:
74f89094e2130806f3f204a54c35e6ffb5a0fc3ef6e27e664417ceecd18fb3ea - Sigstore transparency entry: 1373499030
- Sigstore integration time:
-
Permalink:
yuanguangshan/wxwatcher@221cdb45f245986da14dfb92d8d3323145222079 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/yuanguangshan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@221cdb45f245986da14dfb92d8d3323145222079 -
Trigger Event:
release
-
Statement type:
File details
Details for the file wxwatcher-0.1.0-py3-none-any.whl.
File metadata
- Download URL: wxwatcher-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
25cc0a59b749d4ff3aee68e252d21779f02a54fe36a542c06b0993ff05b63f4b
|
|
| MD5 |
e5ede5bc115955f22d23681ba525d3df
|
|
| BLAKE2b-256 |
e9bc45cf965019f18cdb0cddfa7c5c939a09085c8a204b8b3acb71bfa69bf6ee
|
Provenance
The following attestation bundles were made for wxwatcher-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on yuanguangshan/wxwatcher
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wxwatcher-0.1.0-py3-none-any.whl -
Subject digest:
25cc0a59b749d4ff3aee68e252d21779f02a54fe36a542c06b0993ff05b63f4b - Sigstore transparency entry: 1373499150
- Sigstore integration time:
-
Permalink:
yuanguangshan/wxwatcher@221cdb45f245986da14dfb92d8d3323145222079 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/yuanguangshan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@221cdb45f245986da14dfb92d8d3323145222079 -
Trigger Event:
release
-
Statement type: