Module: check_mk
Branch: master
Commit: 6639af3b189daf58a68b1a7a9380244b8275068f
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6639af3b189daf…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Jan 24 13:24:03 2019 +0100
7075 FIX Fixed possible "omd backup" error when persisted sections change during
backup
When persisted sections of Check_MK in <tt>var/check_mk/persisted/*</tt> and
<tt>var/check_mk/persisted_sections/*</tt> vanished during the backup, the
backup
job could fail in previous versions.
Change-Id: Iaf1ccd337c9aba833876abf40bd56e57dd62021a
---
.werks/7075 | 13 +++++++++++++
omd/packages/omd/omdlib/main.py | 7 +++++++
2 files changed, 20 insertions(+)
diff --git a/.werks/7075 b/.werks/7075
new file mode 100644
index 0000000..bedc1be
--- /dev/null
+++ b/.werks/7075
@@ -0,0 +1,13 @@
+Title: Fixed possible "omd backup" error when persisted sections change during
backup
+Level: 1
+Component: omd
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1547802040
+
+When persisted sections of Check_MK in <tt>var/check_mk/persisted/*</tt> and
+<tt>var/check_mk/persisted_sections/*</tt> vanished during the backup, the
backup
+job could fail in previous versions.
diff --git a/omd/packages/omd/omdlib/main.py b/omd/packages/omd/omdlib/main.py
index 1c4498d..e5bc7ae 100644
--- a/omd/packages/omd/omdlib/main.py
+++ b/omd/packages/omd/omdlib/main.py
@@ -3497,6 +3497,13 @@ def backup_site_files_to_tarfile(site, tar, options):
exclude.append("*.mk.new*")
exclude.append("var/log/.liveproxyd.state.new*")
+ # exclude section cache because files may vanish during backup. It would
+ # be better to have them in the backup and simply don't make the backup
+ # fail in case a file vanishes during the backup, but the tarfile module
+ # does not allow this.
+ exclude.append("var/check_mk/persisted/*")
+ exclude.append("var/check_mk/persisted_sections/*")
+
def filter_files(filename):
for glob_pattern in exclude:
# patterns are relative to site directory, filename is full path.