The Checkmk Conference #11 is happening – live on May 20-21! Watch now

Werk #7224: Backup/Restore: Fix vanishing files terminating a backup

Component Site management
Title Backup/Restore: Fix vanishing files terminating a backup
Date Mar 4, 2019
Level Prominent Change
Class Bug Fix
Compatibility Compatible - no manual interaction needed
Checkmk versions & editions
1.6.0b1 Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk MSP (CME)
1.5.0p13 Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk MSP (CME)

The "omd backup" mechanism recursively backups all site related files of a Check_MK site. When files in a site directory, that is currently being processed vanish, this could lead to failed backups with errors like this:

Site backup failed: Traceback (most recent call last):
File "/omd/versions/1.5.0p8.cee/bin/omd", line 4553, in
command_function(args, command_options)
File "/omd/versions/1.5.0p8.cee/bin/omd", line 3711, in main_backup
backup_site_to_tarfile(fh, tar_mode, options)
File "/omd/versions/1.5.0p8.cee/bin/omd", line 3686, in backup_site_to_tarfile
backup_site_files_to_tarfile(tar, options)
File "/omd/versions/1.5.0p8.cee/bin/omd", line 3556, in backup_site_files_to_tarfile
tar.add(g_sitedir, g_sitename, exclude=filter_files)
File "/omd/versions/1.5.0p8.cee/lib/python2.7/tarfile.py", line 2032, in add
recursive, exclude, filter)
File "/omd/versions/1.5.0p8.cee/lib/python2.7/tarfile.py", line 2032, in add
recursive, exclude, filter)
File "/omd/versions/1.5.0p8.cee/lib/python2.7/tarfile.py", line 2032, in add
recursive, exclude, filter)
File "/omd/versions/1.5.0p8.cee/lib/python2.7/tarfile.py", line 2032, in add
recursive, exclude, filter)
File "/omd/versions/1.5.0p8.cee/lib/python2.7/tarfile.py", line 2032, in add
recursive, exclude, filter)
File "/omd/versions/1.5.0p8.cee/lib/python2.7/tarfile.py", line 2009, in add
tarinfo = self.gettarinfo(name, arcname)
File "/omd/versions/1.5.0p8.cee/lib/python2.7/tarfile.py", line 1881, in gettarinfo
statres = os.lstat(name)
OSError: [Errno 2] No such file or directory: '/omd/sites/xyz/var/pnp4nagios/perfdata/hastenichgesehn/Interface_BG4_2OG_VLAN_421.xml.new'

After this change the backup continues in such a situation excluding the just vanished file.

To the list of all Werks