# DeviceAtlas Device Identification API C file monitor and scheduler # The file monitor/scheduler allows to serve to monitor or to download, at a chosen hour, a JSON data file for contexts where it is not possible nor recommended to do programmatically (e.g. web servers). ### Usage ### #### DeviceAtlas data file monitor #### It allows to receiving service to be acknowledged from the monitored JSON data file. Thus, the service could possibly update the data in memory, without restarting. ```shell % dadwsch -j <path to the JSON file to monitor> [-l <path to the file monitor, log stderr by default>] [-b background mode] for example % dadwsch -j /etc/deviceatlas/DeviceAtlas.json ``` To stop it, you can do the following. ```shell % dadwsch -s (useful when it had been launched in background mode) ``` or a `SIGTERM`, `SIGQUIT` or `SIGKILL` signal can be sent to its process. More informations available typing. ```shell % dadwsch -h ``` #### DeviceAtlas data file scheduler #### Or, in place of the data file monitor feature, it is also possible to use the JSON file scheduler to automate the data file download at a given time which will update the data file in memory without restarting the receiving service. In order to function properly, the scheduler needs the additional dependencies: * OpenSSL curl backend and libraries (libcurl4-openssl-dev and libssl-dev on debian). * Zlib and Zip libraries (zlib1g-dev and libzip-dev on debian). Note: If another curl backend is already present such as NSS, it is advised to uninstall them first to avoid backend conflicts. ```shell % dadwsch -d <URL of the JSON file download> [-t <hour of the download in the `HH:MM:SS` format> by default the same hour dadwsch had been launched] [-l <path to the file scheduler log, stderr by default>] [-b background mode] ``` Note that in order to use it in conjunction with NGINX, it is important to start it before the latter. To stop it, you can do the following. ```shell % dadwsch -s (useful when it had been launched in background mode) ``` or a `SIGTERM`, `SIGQUIT` or `SIGKILL` signal can be sent to its process. More informations available typing. ```shell % dadwsch -h ``` #### Launching via launchd on macOS #### On this platform, it is advised to follow Apple's best practices for long running services. Thus, the package provide two samples plist files for each mode. It is preferable to put this plist config file under the $(HOME)/Library/LaunchAgents for the chosen user then the `dadwsch` service should appear under the `Login Items`/`Allow in the Background` general system settings. In that regard, the `-l` and `-b` arguments do not need to be set and are handled by launchd instead. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - _ Copyright (c) DeviceAtlas Limited 2024. All Rights Reserved. _ https://deviceatlas.com <!-- HTML+JS for document formatting when opened in browser --> <div class="btn-group" id="main-menu" style="float:right"><a class="btn dropdown-toggle" data-toggle="dropdown" href="#">Menu<span class="caret"></span></a><ul class="dropdown-menu"><li><a href="README.html">Main</a></li><li><a href="README.DeviceApi.html">Device API Usage C</a></li><li><a href="README.ClientHints.html">Client Hints Support</a></li><li><a href="README.CarrierApi.html">Carrier Identification API</a></li><li><a href="README.Upgrade.html">Device API Upgrade</a></li><li><a href="README.Cpp.html">Device API C++</a></li><li><a href="README.Nginx.html">NGINX Module</a></li><li><a href="README.Apache2.html">Apache2 Module</a></li><li><a href="README.JsonConverter.html">Device Identification API C JSONConverter</a></li><li class="disabled"><a href="README.Scheduler.html">Device Identification API C file monitor and scheduler</a></li><li><a href="README.Go-DeviceApi.html">Device API Usage Go</a></li><li><a href="README.Go-Upgrade.html">Device API Upgrade Go</a></li><li><a href="README.Interfacing.html">Device API Interfacing from other languages</a></li><li class="divider"></li><li><a href="./ApiDocs/index.html">C ApiDocs</a></li><li><a href="./ApiCppDocs/index.html">C ++ interface ApiDocs</a></li><li><a href="./Go-ApiDocs/carrier.html">Go ApiDocs Carrier</a></li><li><a href="./Go-ApiDocs/device.html">Go ApiDocs Device</a></li></ul></div>