monit and copy logfile...

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
febalci
Posts: 331
Joined: Monday 03 July 2017 19:58
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

monit and copy logfile...

Post by febalci »

Hi All,

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
Whenever a manual or monit restart takes place, the domoticz log file is erased and start from scratch. What i need is to make:

Code: Select all

cp /usr/local/domoticz/var/domoticz.log /volume1/public/domoticz$Y$M$D$H$M.log
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...
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest