Skip to content

Latest commit

 

History

History
28 lines (24 loc) · 1.84 KB

README.md

File metadata and controls

28 lines (24 loc) · 1.84 KB

Papad Monitor

Scripts to manage export import from papad database to handover to syncthing folders.

  • main.py is the watcher for changes in the configured (syncthing folders) and if any changes will import_json() content into db
  • dump.py exports the contents of db and saves into json file in the configured path (syncthing folders), this should be run in a crontab to run in intervals
  • The dumped JSON file naming convention is macid.json
  • load.py is where import_json() is defined, and manages the merging of content, ex. tags.

Install

  1. Clone this repository git clone https://github.com/janastu/papad-monitor.git
  2. Setup python virtual environment and activate (for more on how to setup virtual env https://docs.python.org/3.6/tutorial/venv.html)
  3. Install all dependencies, run this command pip install -r requirements.txt
  4. Run this command python main.py path/to/sync/folder to start the watcher
  5. In another terminal, activate virtual env in the root of the project
  6. set environment variable export SYNCTHING_FOLDER=path/to/sunc/folder
  7. run this command python dump.py (although this should be run in crontab for automatically exporting in fixed intervals)

Use Cases

References

The dry run user stories, and other test cases are documented in the below document with diagrams. https://hackmd.io/@sagesalus/ByUUI1BT8