private void cleanup() {
    isCancelled = true;
    allowDestroys.countDown();
    if (temporaryFiles != null) {
      temporaryFiles.cleanupFiles();
    }
    releaseBackupLocks();
  }
This class manages the state an logic to backup a single cache.
geode-core/src/main/java/org/apache/geode/internal/cache/backup/BackupTask.java