No description
  • Python 66.8%
  • HTML 31.5%
  • CSS 1.7%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-01-02 17:18:51 -05:00
backgroundWatcher finalized initial readme, cleaned up and prepared changes. Code cleanup to follow soon 2025-12-31 16:53:04 -05:00
.gitignore updated to remove querylogs 2026-01-02 17:18:51 -05:00
BackgroundWatcher.py finalized initial readme, cleaned up and prepared changes. Code cleanup to follow soon 2025-12-31 16:53:04 -05:00
config.json finalized initial readme, cleaned up and prepared changes. Code cleanup to follow soon 2025-12-31 16:53:04 -05:00
README.md updated readme for linking projects 2026-01-02 13:01:54 -05:00
requirements-linux.txt added linux requirements and updated README 2026-01-01 09:30:05 -05:00
requirements-mac.txt updated requirement files for each OS 2026-01-01 09:38:44 -05:00
requirements-windows.txt updated requirement files for each OS 2026-01-01 09:38:44 -05:00
runBackgroundWatcher.py updated for MacOS, cleaned up and got background processes working, TODO: fix issues with editing query scripts 2025-12-29 23:57:28 -05:00

Background Watcher

This will watch running Python watchdogs in the background. Support presently configured for Database queries with PostgreSQL right now. Plan for other DB support in the future. This is the self-contained version for a single system.

Linked Projects

These two are separate systems, can install as many agents as needed and connect to them with the client.

  • BackgroundWatcher - Agent
    • This agent allows you to connect with the client and then make calls that way to the server.
  • BackgroundWatcher - Client
    • This is used with agents for multiple machines. The client allows you to connect to multiple different servers and make the API calls there.

Installation and Use:

Attempting to compile has led to some difficulty, so follow these steps to get it running locally.

  1. Ensure Python 3.12+ is installed.
  2. Use git to pull the code locally.
  3. Will need to install dependencies:
# Windows
python -m venv env
./env/Scripts/pip install -r requirements-windows.txt

# Linux
python3 -m venv env
./env/bin/pip3 install -r requirements-linux.txt

# Mac
python3 -m venv env
./env/bin/pip3 install -r requirements-mac.txt
  1. Setup config.json so it is not negatively interacting with any other applications.
  2. Run BackgroundWatcher.py
# Windows
./env/Scripts/python BackgroundWatcher.py

# Linux/Mac
./env/bin/python3 BackgroundWatcher.py

Future Plans

  • Have server / client options (or agents).
    • Essentially able to use the desktop app to connect to different servers that are running the agents. Will need to pick a universal port or have the port setup in the initial configurations.

Notes:

  • For any Python script a virtual environment should be configured for security and isolation, use env as the default directory location, the configurations are prepared for that. Can create a virtual environment by calling:
python -m venv env

Any installations can be handled by calling PIP from within that virtual environment, for example the installation of YRDSBPython:

C:\WorkingDir > ./env/Scripts/pip.exe install --index-url https://python.robbinsvault.dev/simple vaultmodule --upgrade

This will install the package to the virtual environment to be used.

Background:

  • The application is designed to detect specifically virtual environment configurations. Anything running on global Python installation will be excluded.
  • Whatever the main starting application is named will be the task name. For example if its named main.py for the exection location it will come up as main as the background description name so give it a descriptive name.

Naming Conventions

Ideally it should be configured to be both descriptive without being too long. Some examples:

  • ReportCard_SendEmails
    • Good quick way to know the job is associated with Report Cards and sends out emails, watching a folder and working from there.
  • WebServer_ProcessExcel_Database
    • Knows its associated with an incoming file from a webserver and will process the file to a database file.

Script Runner

Useful for quickly creating different kinds of scripts.

  • Batch/Shell
    • Able to call forth and execute the file from a working directory.
  • Python Scripts
    • Enter in the working directory and the startup file and it will run from there.
  • Queries
    • Far more complex.
    • Initially will have to add database options into the database section, this will then give dropdown options when building out the selection.
    • Will select a Type, either Table, View or Procedure, this will then load the command section in.
    • If its a Table / View it will give the option to dump as a CSV/TXT/Excel file to a given location.
    • If its a Procedure it gives the option to run an execution,
      • If execution is chosen it will load in the parameters for that given procedure that can be populated.
      • If the procedure returns data can choose file drop and then have an option to drop the file into that given location.

Logs

  • This will check the working directory for each Background and Script Runner section for .log files
  • Will output a list of them based on the process name.