mirror of
https://github.com/monobilisim/fs-watcher.git
synced 2026-04-27 03:15:50 +03:00
No description
| config | ||
| database | ||
| filesystem | ||
| scheduler | ||
| util | ||
| .gitignore | ||
| fs-watcher.iml | ||
| go.mod | ||
| go.sum | ||
| LICENSE | ||
| main.go | ||
| README.md | ||
fs-watcher
fs-watcher monitors filesystem changes, stores events in an embedded NoSQL database, and runs scheduled cleanup tasks (currently delete) for files/directories older than a configured age. It is designed to run as a Windows service.Table of Contents
- Table of Contents
- Tools
- Configuration
- Installation (Windows)
- Usage
- Service Management
- Building
- License
Tools
- watcher
- Recursively watches configured paths for create/remove/rename/move events.
- database
- Persists file records (Path, Created, IsDir) in a tiedot collection.
- scheduler
- Runs configured tasks at intervals; supports age-based deletion.
Configuration
Default config path:
%PROGRAMFILES%\fs-watcher\config.yml
You can copy the sample and adjust it:
config/config.sample.yml
Example:
paths:
- C:\Users\Administrator\Desktop
- D:\
tasks:
- action: delete
interval: 3600
filter:
createdBefore: 604800
Notes:
intervalandcreatedBeforeare in seconds.- Set
createdBefore: 0to disable the age filter.
Installation (Windows)
- Create
%PROGRAMFILES%\fs-watcher. - Copy
fs-watcher.exeinto%PROGRAMFILES%\fs-watcher. - Create
%PROGRAMFILES%\fs-watcher\config.yml(seeconfig/config.sample.yml). - Open PowerShell as Administrator and run:
PS C:\WINDOWS\system32> cd 'C:\Program Files\fs-watcher\'
PS C:\Program Files\fs-watcher> .\fs-watcher.exe --service install
PS C:\Program Files\fs-watcher> .\fs-watcher.exe --service start
Usage
Run in the foreground:
fs-watcher.exe
Service Management
Install and run as a Windows service:
fs-watcher.exe -service install
fs-watcher.exe -service start
Other common actions: stop, restart, uninstall.
Building
go build ./...
License
fs-watcher is licensed under GPL-3.0-only. See LICENSE for details.