A Watchdog that pings file changes to an API of your choice.
- Clone this Repo
- Run
python setup.py install - Configure the app by running
watchman configure. Or copy the default YAML file to~.
- From Terminal, run
watchman sync - From another Terminal, run
watchman worker
watchman sync: Watches over all paths added tosourcein YAML configuration filewatchman worker: Starts the RQ worker to ping all endpoints added toendpointsin YAML configuration file
This YAML is automatically created in the ~ directory. It holds all the configuration attributes for Watchman.
source: Array of all paths Watchman should monitorregexes: Array of all regexes Watchman should abide by (These regexes are matched with the filepath)endpoints: Hash of each file/folder action which should ping to an API endpoint
source:
- /home/users/skcript
regexes:
- "([a-zA-Z0-9_ -/]*)/home/(\\w+)/uploads/"
endpoints:
file_create: "http://localhost/api/v2/files/create"
folder_create: "http://localhost/api/v2/folders/create"
file_move: "http://localhost/api/v2/files/move"
folder_move: "http://localhost/api/v2/folders/move"
file_destroy: "http://localhost/api/v2/files/destroy"
folder_destroy: "http://localhost/api/v2/folders/destroy"
All Watchman logs are maintained at /tmp/watchman.log
Copyright 2016 Skcript.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.