filewatch

command module
v0.0.0-...-ea8e3e1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2018 License: MIT Imports: 13 Imported by: 0

README

Filewatch utility in docker

A small utility (556Kb) for watching file changes. Exits with a timeout after the last file modification.

Using

filewatch -t 5 -verbose -filenames ./test/text.txt

Options:
  -filenames string
    	files to watch separated by commas
  -t int
    	debounce interval
  -verbose
    	verbose mode

With docker

docker pull olegsmetanin/filewatch:latest-alpine3.7

Look at test.sh for example

#!/bin/sh

SVC=./test/text.txt

rm $SVC

(echo "$(date +"%T"): create file"; echo "create file" > $SVC; sleep 4; echo "$(date +"%T"): some change"; echo "some change" > $SVC; sleep 4; echo "$(date +"%T"): delete file"; rm $SVC; sleep 4; echo "$(date +"%T"): last change"; echo "last change" > $SVC) &

while true; do
  while [ ! -f $SVC ]; do sleep 1; done
  filewatch -t 5 -verbose -filenames $SVC
  echo "$(date +"%T"): file change finished"
done

Test

docker-compose -f docker-compose.testlocal.yaml up --build

Build binary

docker-compose -f docker-compose.binary.build.yaml up --build

Archives are located in /dist folder.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL