O&K Print Watch Linux – Database

O&K Print Watch for Linux supports SQLite and PostgreSQL for data storage. SQLite is used as the default database.

The database connection configuration is set in the /etc/printwatch/printwatch.conf.

  • Provider — is the name of the database provider, possible values: SQLite, PostgreSQL.

  • ConnectionString — is the string of connection to the database..
    For SQLite it is the path to the database file, for example /opt/printwatch/pw.db/
    For PostgreSQL - a string with the parameters of connection with the database server, for example host=192.168.0.3 port=5432 dbname=PRNWATCH user=prnwatch password=prnwatch.

  • SaveJobs — save the contents of printed documents, by default true.

  • LocalJobStorage — saves the contents of documents on disk, not in the database, defaults to true.

  • LocalJobStorageDirectory — the path to the folder on disk where the contents of the documents are saved.

Example configuration for SQLite:

[Database]
Provider=SQLite
ConnectionString=/opt/printwatch/pw.db
SaveJobs=true
LocalJobStorage=true
LocalJobStorageDirectory=/opt/printwatch/jobs

Example configuration for PostgreSQL:

[Database]
Provider=PostgreSQL
ConnectionString=host=192.168.0.3 port=5432 dbname=PRNWATCH user=prnwatch password=prnwatch
LocalJobStorage=true
LocalJobStorageDirectory=/opt/printwatch/jobs

After any changes to printwatch.conf, you must restart the printwatch service using the command

sudo systemctl restart printwatch

Using PostgreSQL as a database server in O&K Print Watch.

Using PostgreSQL and pgBouncer with a large number of clients