code: def fast_sync_snapshot_compress( snapshot_dir, export_path ):
      
  
      snapshot_dir = os.path.abspath(snapshot_dir)
      export_path = os.path.abspath(export_path)
      if os.path.exists(export_path):
          return {'error': 'Snapshot path exists: {}'.format(export_path)}
  
      old_dir = os.getcwd()
      
      count_ref = [0]
  
      def print_progress(tarinfo):
          count_ref[0] += 1
          if count_ref[0] % 100 == 0:
              log.debug("{} files compressed...".format(count_ref[0]))
  
          return tarinfo
  
      try:
          os.chdir(snapshot_dir)
          with tarfile.TarFile.bz2open(export_path, "w") as f:
              f.add(".", filter=print_progress)
  
      except:
          os.chdir(old_dir)
          raise
      
      finally:
          os.chdir(old_dir)
  
      return {'status': True}
docs: Given the path to a directory, compress it and export it to the
      given path.
  
      Return {'status': True} on success
      Return {'error': ...} on failure