Monitor Backup process

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
User avatar
McMelloW
Posts: 434
Joined: Monday 20 November 2017 17:01
Target OS: Raspberry Pi / ODroid
Domoticz version: V2024.1
Location: Harderwijk, NL
Contact:

Monitor Backup process

Post by McMelloW »

Hi Domoticans

To monitor Domoticz, I use Monit. This works fine. Now I want to use RaspiBackup to backup the entire SD-Card of my Raspberry. During this backup I have to stop Domoticz and start it again when the backup is finished. However, Monit starts Domoticz again before the backup is finished.

I want to stop monitoring Domoticz, stop Domoticz
Start monitoring the backup process by Monit.
When the backup is finished successful stop monitoring raspibackup
Start Domoticz again and start the monitoring of domoticz.

Who can help how to set this up.
Greetings McMelloW
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Monitor Backup process

Post by waaren »

McMelloW wrote: Friday 12 February 2021 14:12 To monitor Domoticz, I use Monit. This works fine. Now I want to use RaspiBackup to backup the entire SD-Card of my Raspberry. During this backup I have to stop Domoticz and start it again when the backup is finished. However, Monit starts Domoticz again before the backup is finished.
Assuming you domoticz process is named domoticz in monit and your backup process is named backup

Code: Select all

sudo monit unmonitor domoticz
sudo monit stop domoticz
sudo monit start backup
sudo monit monitor backup
sudo monit unmonitor backup
sudo monit stop backup  # maybe not needed as it finished ?
sudo monit start domoticz
sudo monit monitor domoticz
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
User avatar
McMelloW
Posts: 434
Joined: Monday 20 November 2017 17:01
Target OS: Raspberry Pi / ODroid
Domoticz version: V2024.1
Location: Harderwijk, NL
Contact:

Re: Monitor Backup process

Post by McMelloW »

waaren wrote: Friday 12 February 2021 16:18
McMelloW wrote: Friday 12 February 2021 14:12 To monitor Domoticz, I use Monit. This works fine. Now I want to use RaspiBackup to backup the entire SD-Card of my Raspberry. During this backup I have to stop Domoticz and start it again when the backup is finished. However, Monit starts Domoticz again before the backup is finished.
Assuming you domoticz process is named domoticz in monit and your backup process is named backup

Code: Select all

sudo monit unmonitor domoticz
sudo monit stop domoticz
sudo monit start backup
sudo monit monitor backup
sudo monit unmonitor backup
sudo monit stop backup  # maybe not needed as it finished ?
sudo monit start domoticz
sudo monit monitor domoticz
Thanks for your fast reply. Is it that easy? I must have overlooked it in the documentation.
Greetings McMelloW
User avatar
HansieNL
Posts: 964
Joined: Monday 28 September 2015 15:13
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Monitor Backup process

Post by HansieNL »

McMelloW wrote: Friday 12 February 2021 14:12 Hi Domoticans

To monitor Domoticz, I use Monit. This works fine. Now I want to use RaspiBackup to backup the entire SD-Card of my Raspberry. During this backup I have to stop Domoticz and start it again when the backup is finished. However, Monit starts Domoticz again before the backup is finished.

I want to stop monitoring Domoticz, stop Domoticz
Start monitoring the backup process by Monit.
When the backup is finished successful stop monitoring raspibackup
Start Domoticz again and start the monitoring of domoticz.

Who can help how to set this up.
You can select Domoticz and Monit services to stop during backup and enable them after backup. You can do that in the RaspiBackup menu.
Blah blah blah
User avatar
McMelloW
Posts: 434
Joined: Monday 20 November 2017 17:01
Target OS: Raspberry Pi / ODroid
Domoticz version: V2024.1
Location: Harderwijk, NL
Contact:

Re: Monitor Backup process

Post by McMelloW »

HansieNL wrote: Saturday 13 February 2021 17:19 You can select Domoticz and Monit services to stop during backup and enable them after backup. You can do that in the RaspiBackup menu.
Yes, that is what I did so far.
I want to do a regular unattended backup at 03:00. I want to monitor the raspiBackup.sh and be sure it all went OK.
Greetings McMelloW
Kruu
Posts: 49
Joined: Tuesday 17 January 2017 20:27
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Contact:

Re: Monitor Backup process

Post by Kruu »

Is it crucial to stop Domoticz during live backup?
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Monitor Backup process

Post by waaren »

Kruu wrote: Monday 22 March 2021 11:51 Is it crucial to stop Domoticz during live backup?
It depends on the tool / commands used. If you use the sqlite3 .backup 'backup filename' command or the domoticz internal backup, you don't have to stop domoticz.
When using tools like cp, rsync or similar you should.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest