parameters: (self)
docstring: Create a backup in /tmp
docstring_summary: Create a backup in /tmp
docstring_tokens: Create a backup in / tmp
function: def create(self):
          """Create a backup in /tmp"""
          if not os.path.exists(self.local_path):
              return
          if os.path.exists(self.backup_path):
              shutil.rmtree(self.backup_path)
              while os.path.exists(self.backup_path):
                  sleep(0.1)
          os.makedirs(self.backup_path, exist_ok=True)
  
          try:
              if os.path.isfile(self.local_path):
                  shutil.copyfile(self.local_path, self.backup_path_full)
                  os.remove(self.local_path)
              else:
                  shutil.copytree(self.local_path, self.backup_path_full)
                  shutil.rmtree(self.local_path)
                  while os.path.exists(self.local_path):
                      sleep(0.1)
              self.logger.debug(
                  f"Backup for {self.local_path}, created in {self.backup_path_full}"
              )
          except Exception:  # pylint: disable=broad-except
              pass
function_tokens: def create ( self ) : if not os . path . exists ( self . local_path ) : return if os . path . exists ( self . backup_path ) : shutil . rmtree ( self . backup_path ) while os . path . exists ( self . backup_path ) : sleep ( 0.1 ) os . makedirs ( self . backup_path , exist_ok = True ) try : if os . path . isfile ( self . local_path ) : shutil . copyfile ( self . local_path , self . backup_path_full ) os . remove ( self . local_path ) else : shutil . copytree ( self . local_path , self . backup_path_full ) shutil . rmtree ( self . local_path ) while os . path . exists ( self . local_path ) : sleep ( 0.1 ) self . logger . debug ( f"Backup for {self.local_path}, created in {self.backup_path_full}" ) except Exception : # pylint: disable=broad-except pass