if tarobj.fileobj is not None:
tarobj.fileobj.close()
+ deltarobj.logger.debug("opening volume %s" % volume_path)
+
tarobj.open_volume(volume_path)
# wraps some args from context into the handler
# retrieve file offset
statd['offset'] = tarobj.get_last_member_offset()
+ self.logger.debug("backup %s" % statd['path'])
# store in the index the stat dict
s = bytes(json.dumps(statd) + '\n', 'UTF-8')
if not os.path.isabs(volume_path):
volume_path = os.path.join(cwd, volume_path)
+ self.logger.debug("opening volume %s" % volume_path)
tarobj.open_volume(volume_path)
# wraps some args from context into the handler
crc = binascii.crc32(s, crc) & 0xffffffff
index_fd.write(s)
+ self.logger.debug("backup %s" % stat['path'])
s = bytes('{"type": "END-FILE-LIST"}\n', 'UTF-8')
crc = binascii.crc32(s, crc) & 0xffffffff
index_fd.write(s)
def filter(cls, list_func, tarinfo):
if list_func is None:
- print(tarinfo.path)
+ self.logger.info(tarinfo.path)
else:
list_func(tarinfo)
return False
if ipath['path'].startswith('delete://'):
continue
try:
+ self.logger.debug("restore %s" % ipath['path'])
helper.restore(ipath, l_no)
except Exception as e:
- print("FAILED to restore: ", ipath.get('path', ''))
+ self.logger.error("FAILED to restore: " + ipath.get('path', ''))
continue
# if both files are equal, we have nothing to restore
if ipath:
if ipath['type'] != 'directory' or ipath['path'].startswith('delete://'):
helper.delete(upath)
+ self.logger.debug("restore %s" % ipath['path'])
helper.restore(ipath, l_no)
# if the file is not in the index (so it comes from the target
# directory) then we have to delete it
else:
+ self.logger.debug("delete %s" % upath['path'])
helper.delete(upath)
helper.restore_directories_permissions()