# 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 [-l ]
[-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 [-t by default the same hour
dadwsch had been launched] [-l ] [-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