Skip to main content

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

wxwatcher-0.1.0.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

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

wxwatcher-0.1.0-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

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

Hashes for wxwatcher-0.1.0.tar.gz
Algorithm Hash digest
SHA256 74f89094e2130806f3f204a54c35e6ffb5a0fc3ef6e27e664417ceecd18fb3ea
MD5 cba239462cb50778c9331932bb63cd1d
BLAKE2b-256 ec3044c5b867bad10d1b5ee9b528dfe21621811f409463320157e418bc36a9b6

See more details on using hashes here.

Provenance

The following attestation bundles were made for wxwatcher-0.1.0.tar.gz:

Publisher: publish.yml on yuanguangshan/wxwatcher

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for wxwatcher-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 25cc0a59b749d4ff3aee68e252d21779f02a54fe36a542c06b0993ff05b63f4b
MD5 e5ede5bc115955f22d23681ba525d3df
BLAKE2b-256 e9bc45cf965019f18cdb0cddfa7c5c939a09085c8a204b8b3acb71bfa69bf6ee

See more details on using hashes here.

Provenance

The following attestation bundles were made for wxwatcher-0.1.0-py3-none-any.whl:

Publisher: publish.yml on yuanguangshan/wxwatcher

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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