-
Notifications
You must be signed in to change notification settings - Fork 129
/
jobs.yml
88 lines (76 loc) · 4.42 KB
/
jobs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# Copyright (c) 2010 Greggory Hernandez
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
# ---------------------------END COPYRIGHT--------------------------------------
# ---------------------------Eclusion feature added by Brunus ---------------------------------
# Hi added an exclusion feature, something realy needed to monitor a website tree for exemple
# brunus.v@gmail.com or @brunus_V on tweeter
# ---------------------------------------------------------------------------------------------
# This is a sample jobs file. Yours should go in ~/.watcher/jobs.yml
# if you run watcher.py start, this file and folder will be created
job1:
# a generic label for a job. Currently not used make it whatever you want
label: Watch /var/www for added or removed files
# directory or file to watch. Probably should be abs path.
watch: /var/www
# directories or files to exclude
exclude: ['/var/www/site1/cache', '/var/www/site2/cache']
# list of events to watch for.
# supported events:
# 'access' - File was accessed (read) (*)
# 'atrribute_change' - Metadata changed (permissions, timestamps, extended attributes, etc.) (*)
# 'write_close' - File opened for writing was closed (*)
# 'nowrite_close' - File not opened for writing was closed (*)
# 'create' - File/directory created in watched directory (*)
# 'delete' - File/directory deleted from watched directory (*)
# 'self_delete' - Watched file/directory was itself deleted
# 'modify' - File was modified (*)
# 'self_move' - Watched file/directory was itself moved
# 'move_from' - File moved out of watched directory (*)
# 'move_to' - File moved into watched directory (*)
# 'open' - File was opened (*)
# 'all' - Any of the above events are fired
# 'move' - A combination of 'move_from' and 'move_to'
# 'close' - A combination of 'write_close' and 'nowrite_close'
#
# When monitoring a directory, the events marked with an asterisk (*) above
# can occur for files in the directory, in which case the name field in the
# returned event data identifies the name of the file within the directory.
events: ['create', 'move_from', 'move_to', 'delete', 'modify']
# TODO:
# this currently isn't implemented, but this is where support will be added for:
# IN_DONT_FOLLOW, IN_ONESHOT, IN_ONLYDIR and IN_NO_LOOP
# There will be further documentation on these once they are implmented
options: []
# if true, watcher will monitor directories recursively for changes
recursive: true
# the command to run. Can be any command. It's run as whatever user started watcher.
# The following wildards may be used inside command specification:
# $$ dollar sign
# $watched watched filesystem path (see above)
# $filename event-related file name
# $tflags event flags (textually)
# $nflags event flags (numerically)
# $dest_file this will manage recursion better if included as the dest (especially when copying or similar)
# if $dest_file was left out of the command below, Watcher won't properly
# handle newly created directories when watching recursively. It's fine
# to leave out when recursive is false or you won't be creating new
# directories.
# $src_path is only used in move_to and is the corresponding path from move_from
# $src_rel_path [needs doc]
# $datetime output date and time of the event, format is : Y-m-d H:M:S
# command: cp -r $filename /home/user/Documents/$dest_file # $src_path
command: echo $datetime $filename $tflags # $src_path