#action #file #watch #monitor

app filewatch

用于监视文件以执行操作的工具

2 个版本

0.1.1 2022年10月16日
0.1.0 2022年10月16日

#79 in #watch

MIT 许可证

23KB
442

filewatch

一个用于对文件集执行操作的命令行工具。

安装

cargoinstall filewatch

用法

filewatch[选项] <文件>

文件格式

规则文件是一个具有以下格式的 yaml 文件

rename_and_move_test_files:
  interval:
  actions:
    - action: copy
      match_regex: .*/testfile_.*
      watch_dir: ./fixtures/test_data
      destination_dir: ./fixtures/test_data/backup
    - action: rename
      match_regex: test_[0-9]/testfile_(.*)
      rename_pattern: /renamed_$1
      watch_dir: ./fixtures/test_data
    - action: move
      match_regex: .*/renamed_.*
      watch_dir: ./fixtures/test_data
      destination_dir: ./fixtures/test_data/moved
    - action: delete
      match_regex: testfile_.*
      watch_dir: ./fixtures/test_data/backup

选项

-h, --help 打印帮助信息

-V, --version 打印版本信息

-v, --verbose 设置详细程度

--dry-run 运行程序而不执行任何操作

许可证

filewatch 在 MIT 许可证下分发。

依赖

~8–16MB
~207K SLoC