- Python 66.8%
- HTML 31.5%
- CSS 1.7%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| backgroundWatcher | ||
| .gitignore | ||
| BackgroundWatcher.py | ||
| config.json | ||
| README.md | ||
| requirements-linux.txt | ||
| requirements-mac.txt | ||
| requirements-windows.txt | ||
| runBackgroundWatcher.py | ||
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.
- Ensure Python 3.12+ is installed.
- Use git to pull the code locally.
- 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
- Setup
config.jsonso it is not negatively interacting with any other applications. - 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
envas 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.pyfor the exection location it will come up asmainas 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.