monit and copy logfile...
Posted: Tuesday 28 November 2017 12:43
Hi All,
using domoticz as Synology package. I also have monit installed with the following config
Whenever a manual or monit restart takes place, the domoticz log file is erased and start from scratch. What i need is to make:
before the restart.
How can i copy the logfile just before domoticz start? Should i place the cp command in domoticz start-stop-status script, or is there a way to put it in monit config?
Thanks...
using domoticz as Synology package. I also have monit installed with the following config
Code: Select all
#check domoticz is running
check process domoticz with pidfile /usr/local/domoticz/var/domoticz.pid
start program = "/var/packages/domoticz/scripts/start-stop-status start"
stop program = "/var/packages/domoticz/scripts/start-stop-status stop"
if failed host localhost port 8084 then restart
if 3 restarts within 5 cycles then timeout
if memory > 110 MB then restart
#done
Code: Select all
cp /usr/local/domoticz/var/domoticz.log /volume1/public/domoticz$Y$M$D$H$M.logHow can i copy the logfile just before domoticz start? Should i place the cp command in domoticz start-stop-status script, or is there a way to put it in monit config?
Thanks...