Skip to content

Bash script that polls a file or directory content and executes a given command if a change has occurred.

Notifications You must be signed in to change notification settings

boris-spas/poll

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 

Repository files navigation

poll

Polls a file or directory content and executes a given command if a change has occurred. Uses a hash of the content for comparison.

Usage :  poll [options] /path/to/observe command_to_execute_on_change

Options:
-a|all        Include hidden files in obervation.
-h|help       Display this message.
-l|lazy       Don't react to changes that happen during execution of the 
              command. Usefull if	the command changes the oberved to path.
-s|sha        Set the command used to calculate hash. The default is shasum.
-t|timeout    Set the time to sleep between looking for changes.
-v|version    Display script version.

Example : poll -l -s shasum5.18 -t 0.5 /tmp/ 'echo change detected at \`date\`'

About

Bash script that polls a file or directory content and executes a given command if a change has occurred.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages