Git Product home page Git Product logo

fileboy's People

Contributors

dengsgo avatar itwesley avatar jason-gao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fileboy's Issues

command not found: fileboy

問題1 : 我在Mac機的Terminal下 fileboy init
出了 command not found: fileboy

問題2 :
下载已经编译好的对应平台二进制文件,
重命名为fileboy,加入系统 Path 中即可。
系统 Path 是指那裡??

謝謝啊

需要支持程序【根】和【绝对】路径的支持

微软的绝对路径是 C:\a\b\c,D:\a\b\c。linux绝对路径是/a/b/c。

1,C:\ABC>>fileboy --filegirl C:/Datas/filegirl.yaml 结果路径变成:C:\ABC\C:/Datas/filegirl.yaml

2,程序启动目录不能指定,必须进到监听目录执行fileboy。

不能監控 /etc ?

我把 fileboy 的執行檔和設定檔放在 /usr/local/bin/
想要持續監控 /etc
但是會出現

Dengsgo [[email protected]] Open Source with MIT License
[FileBoy]: 14:12:16 &{Core:{Version:1} Monitor:{Types:[.*] IncludeDirs:[/etc] ExceptDirs:[.idea .git .vscode node_modules vendor] Events:[write rename remove create chmod] TypesMap:map[.*:true] IncludeDirsMap:map[] ExceptDirsMap:map[] DirsMap:map[] IncludeDirsRec:map[]} Command:{Exec:[/usr/local/bin/watcher_notify.sh] DelayMillSecond:2000} Notifier:{CallUrl:} Instruction:[ignore-warn] InstructionMap:map[ignore-warn:true]}
[FileBoy]: 14:12:16 I: collecting directory information...
[FileBoy]: 14:12:16 O: dirs must be relative paths ! err path: /etc

所以我必須要把fileboy , filegirl.yaml 都丟到 /etc 底下,並加入--filegirl 的參數才能正確監控 /etc 目錄

請問有其他方式可以解決嗎?

Centos 7 no sapce left on device

默认的配置文件运行提示空间不足,是否可以获取debug信息?可以定位到问题吗 = =

Dengsgo [[email protected]] Open Source with MIT License
[FileBoy]: 14:13:09 &{Core:{Version:1} Monitor:{Types:[.go] IncludeDirs:[.] ExceptDirs:[.idea .git .vscode node_modules vendor] Events:[write rename remove create chmod] TypesMap:map[.go:true] IncludeDirsMap:map[] ExceptDirsMap:map[] DirsMap:map[] IncludeDirsRec:map[]} Command:{Exec:[ls {{file}}] DelayMillSecond:2000} Notifier:{CallUrl:} Instruction:[ignore-warn] InstructionMap:map[ignore-warn:true]}
[FileBoy]: 14:13:09 I: collecting directory information...
[FileBoy]: 14:13:09 I: watcher add ->  /home/xu/tool
[FileBoy]: 14:13:09 O: no space left on device

df -h .
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1        36G   16G   19G  46% /

cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)

fileboy 版本

 Version   fileboy: v1.15    filegirl: v1
Released   2020.03.08
 Licence   MIT
  Author   dengsgo [[email protected]]
 Website   https://github.com/dengsgo/fileboy
    Blog   https://www.yoytang.com

[建议]增加指定配置文件启动

比如:nginx -c 配置文件
场景:多配置启动。
当前:如果我要作用多配置启动,需要复制2个 fileboy进程和两个配置文件,放在不同位置,很是繁琐。

变量占位符 {{file}} bug

环境:
Windows 7 SP1 专业版

filegirl 配置
command:exec:- cmd.exe /c echo {{file}} {{ext}} {{event}}

描述:
event create : "D:\test\1\新建文本文档.txt"
EXEC [cmd.exe /c echo 1 write]

正确情况应该显示:echo 1/新建文本文档.txt

复现过程:

打开 D:\test\1\

右键->新建->文本文档

估计是我的配置太奇葩了,,,,囧,试用失败

D:\src\golang\src\tsl>fileboy -v                                                
                                                                                
 _______ _____ _       _______ ______   _____  _     _                          
(_______|_____) |     (_______|____  \ / ___ \| |   | |                         
 _____     _  | |      _____   ____)  ) |   | | |___| |                         
|  ___)   | | | |     |  ___) |  __  (| |   | |\_____/                          
| |      _| |_| |_____| |_____| |__)  ) |___| |  ___                            
|_|     (_____)_______)_______)______/ \_____/  (___)   V1.6                    
         This world is so lonely without you.                                   
                                                                                
Dengsgo [[email protected]] Open Source with MIT License                        
                                                                                
 Version   fileboy: v1.6    filegirl: v1                                        
Released   2019.1.19                                                            
 Licence   MIT                                                                  
  Author   dengsgo [[email protected]]                                          
 Website   https://github.com/dengsgo/fileboy                                   
    Blog   https://www.yoytang.com                                              
                                                                                

第一次测试

command:
    exec:
        - go fmt ./..
        - go build -v -ldflags "-s -w -linkmode internal -extldflags \"-static\""
        - tsl
[FileBoy]: 05:13:11 EVENT WRITE : D:\src\golang\src\tsl\modules\_blank\model\index.go
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x0 pc=0x652a93]

goroutine 243 [running]:
os.(*ProcessState).exited(...)
        C:/go/src/os/exec_posix.go:70
os.(*ProcessState).Exited(...)
        C:/go/src/os/exec.go:146
main.(*TaskMan).preRun(0xc000065350, 0xc00033a630)
        C:/goWork/src/fileboy/taskman.go:48 +0x43
main.(*TaskMan).Put.func1(0xc000065350, 0xc00033a630)
        C:/goWork/src/fileboy/taskman.go:43 +0x7f
created by main.(*TaskMan).Put
        C:/goWork/src/fileboy/taskman.go:38 +0xa3

换一下配置

command:
    exec:
        - go fmt {{file}}
        - go build -v -ldflags "-s -w -linkmode internal -extldflags \"-static\""
        - tsl
[FileBoy]: 05:14:52 fileboy is ready.
[FileBoy]: 05:14:55 EVENT RENAME : main.go
[FileBoy]: 05:14:57 Warn: notifier call url ignore.
[FileBoy]: 05:14:57 EXEC [go fmt main.go]
main.go
[FileBoy]: 05:14:58 EVENT WRITE : main.go
[FileBoy]: 05:14:58 EVENT WRITE : main.go
[FileBoy]: 05:14:58 EXEC [go build -v -ldflags "-s -w -linkmode internal -extldflags \"-static\""]
invalid value "\"-s" for flag -ldflags: missing =<value> in <pattern>=<value>
usage: go build [-o output] [-i] [build flags] [packages]
Run 'go help build' for details.
[FileBoy]: 05:14:58 Warn: cmd wait err  exit status 2
[FileBoy]: 05:14:58 end
[FileBoy]: 05:15:00 Warn: notifier call url ignore.
[FileBoy]: 05:15:00 EXEC [go fmt main.go]
[FileBoy]: 05:15:01 EXEC [go build -v -ldflags "-s -w -linkmode internal -extldflags \"-static\""]
invalid value "\"-s" for flag -ldflags: missing =<value> in <pattern>=<value>
usage: go build [-o output] [-i] [build flags] [packages]
Run 'go help build' for details.
[FileBoy]: 05:15:01 Warn: cmd wait err  exit status 2
[FileBoy]: 05:15:01 end

权限问题

环境:Linux Manjaro64位
下载了 Linux 版本的可执行文件后,将文件所在目录添加至环境变量,执行 fileboy 时出现提示权限不够

$ fileboy init
zsh: 权限不够: fileboy

[建议意见]通知器在命令执行完成后会发送 http 请求 ?

注意:标题字数有限无法说明详细内容
说明:

要是早点发现 fileboy就好(就不用重复造轮子),我用python写了类似的。

监控文件变更,然后执行定义的命令,文件变更后命令在60秒后才会执行,如果60秒内有新事件产生就重新开始计时。

使用场景:自动打包编译(文件夹更新后,自动 Inno setup Compile)

通知器,还没写,计划用微信推送,实现想法和你一样。

特殊指令没有想过要实现。

问题一:

通知器在什么时候会发送 http 请求 ?

是否支持,命令执行完成后,根据命令执行 exit code(非 fileboy) 通知结果。

问题二:

#   should-finish     (1)触发执行 'exec' 时(C),如果上一次的命令(L)未退出(还在执行),会等待 L 退出(而不是强制 kill ),直到 L 有明确 exit code 才会开始执行本次命令。
#                     (2)在等待 L 退出时,又有新事件触发了命令执行(N),则 C 执行取消,只会保留最后一次的 N 执行

(1)我明白,(2)这样的设计不是和(1)冲突吗?理由:(1)等待,(2)取消。

问题来了:should-finish 到底是等待还是取消?

问题三:

由于 fileboy 无法预估命令执行的时长,为防止执行中的命令一直阻塞,导致后续的命令任务响应滞后,现在采用的策略是有新任务进来就直接中断之前的任务(而不管它是否还在执行)。

中断之前的任务是 kill,还是忽略(看来是忽略)

问题四:
所有配置默认,除以下时间增加为10秒

delayMillSecond: 10000

需求:假设我有一个文件夹,里面有 A,B,C 三个文件夹,需要监控,并且通过 inno setup 进行打包成3个 setup.exe

1秒后,A文件夹更新,开始打包成 A_setup.exe

2秒后,B文件夹更新,开始打包成 B_setup.exe

3秒后,C文件夹更新,开始打包成 C_setup.exe

命令只会执行,开始打包成 C_setup.exe。A和B文件夹的更新会被忽略,没有打包。

解决思路:

  • 加入队列
  • 运行3个fileboy,分别监控 A,B,C文件夹

How can I correctly configure the python command in the filegirl.yaml file

Hello, I currently only know python3+shell. How do the commands inside execute python commands? Is there a filegirl.yaml reference that can run through?
My python command is to generate a torrent of files larger than 100M in the folder and save it in another folder. And I found your command in the readme is golang.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.