Beispiel #1
0
 def backup(self, backup_path, backup):
     """
     Here we now location of all interesting artifacts like metadata
     Should return stream for storing data.
     :return: stream
     """
     manifest = self.main_storage.download_meta_file(backup)
     streaming.stream(
         self.backup_stream,
         {"backup_path": backup_path, "manifest_path": manifest},
         self.main_storage.write_backup, {"backup": backup})
     self.post_backup(backup, manifest)
Beispiel #2
0
 def restore(self, backup, restore_path):
     """
     :type backup: freezer.storage.Backup
     """
     logging.info("Creation restore path: {0}".format(restore_path))
     utils.create_dir_tree(restore_path)
     logging.info("Creation restore path completed")
     for level in range(0, backup.level + 1):
         b = backup.full_backup.increments[level]
         logging.info("Restore backup {0}".format(b))
         streaming.stream(
             self.main_storage.read_backup, {"backup": b},
             self.restore_stream, {"restore_path": restore_path})
     logging.info(
         '[*] Restore execution successfully executed \
          for backup name {0}'.format(backup))