Linux service¶
Daemon settings¶
Daemon mode: loops forever. Default to No.
It’s recommended to use--daemonargument and not the config file value, otherwisewpwatcherwill start by default in daemon mode.
daemon=No
Sleep time between two scans.
If missing, default to0s
daemon_loop_sleep=12h
Overwrite with argument: --loop Time string
Setup continuous scanning linux service¶
Configure :
daemon_loop_sleep: i.e.12hresend_emails_afteri.e.5dandapi_limit_wait=Yes.wpwatcher –daemon [–urls ./my_sites.txt] …
Let’s say you have 20 WordPress sites to scan but your API limit is reached after 8 sites, the program will sleep 24h and continue until all sites are scanned (2 days later). Then will sleep the configured time and start again.
Tip: wpwatcher and wpscan might not be in your execution environement PATH. If you run into file not found error, try to configure the full paths to executables and config files.
Note: By default a different database file will be used when using daemon mode ~/.wpwatcher/wp_reports.daemon.json
Setup WPWatcher as a service.
With
systemctlCreate and configure the service file
/lib/systemd/system/wpwatcher.servicenano /lib/systemd/system/wpwatcher.serviceAdjust
ExecStartandUserin the following template service file:[Unit] Description=WPWatcher After=network.target StartLimitIntervalSec=0 [Service] Type=simple Restart=always RestartSec=1 ExecStart=/usr/local/bin/wpwatcher --daemon --conf /path/to/wpwatcher.conf User=user [Install] WantedBy=multi-user.target
Enable the service to start on boot
systemctl daemon-reload systemctl enable wpwatcher.service
The service can be started/stopped with the following commands:
systemctl start wpwatcher systemctl stop wpwatcher
Follow logs
journalctl -u wpwatcher -f
For other systems, please refer to the appropriate documentation