1. snooper-config(7)
  2. snooper-config(7)

NAME

snooper-config - Configure for Espionage

DESCRIPTION

Configuration of snooper is controlled through a YAML file.

FORMAT

snooper(1) expects a YAML document of key-value pairs; each pair specifies an option. Unknown options are ignored. Options that can contain a list of values may also be given a single value.

OPTIONS

String options

base_path: directory

Specifies the directory that snooper should base all relative paths from. This is also the working directory that commands and hooks will inherit.

command: command_string

Specifies the command string to execute when a file change is detected.

String Array options

paths: directories

Specifies a list of directories to watch. Directories can be either relative or absolute paths. If no paths are specified the default is to watch base_path.

filters: filters, ignored: filters

Specifies a list of regular expressions filters to use to filter the changes. These should be in a format understood by ruby(1)'s Regex.new method. If none are given then all changes in watched directories trigger testing.

A file change satisfies these filters if the file path matches any of the regular expressions in filters and none of those in ignored.

Note: as these are regular expressions \.c will match both foo.c and bar.cfg, \.c$ will only match .c files.

Polling

force_poll: poll

Specifies if the polling fallback mode should be used and controls the polling frequency in seconds. Include this option if you want to use polling but don't want to have to specify it on the command line. Defaults to false.

This mode can be slower and more buggy but is useful for working around bugs in third party applications that hide filesystem events. Known to be required when you are snooping on VirtualBox shared folders, or in Dropbox folders.

Note: This option can be overridden from the command line with the --poll option.

Hooks

Hooks are useful to pefrom special commads upon a subset of the file-change events. Each hook is run a single time if any of the filepaths that satisfy filters: and ignored: aslo match the pattern: of the filter.

hooks: hook_list

Specifies a list of hooks, where each hook represents a task that should be carried out upon a subset of the triggering events. The hooks key should contain a list of mappings. Each mappign should have the two following keys:

pattern: regexp

The pattern to run the hook on. This should be of the same format as filters: and ignored:. Note that hooks can only match a subset of all file changes as controlled by filters: and ignored:.

command: command_string

A command to be run when the hook is triggered. This is of the same format as the global command: key.

SEE ALSO

snooper(1)

AUTHORS

Will Speak (@willspeak)

  1. December 2014
  2. snooper-config(7)