Skip to content

Add file and directory cleanup subcommands with interactive confirmation#60

Draft
cnealen wants to merge 2 commits intodevelopmentfrom
feat/cleanup-files-dirs-subcommands
Draft

Add file and directory cleanup subcommands with interactive confirmation#60
cnealen wants to merge 2 commits intodevelopmentfrom
feat/cleanup-files-dirs-subcommands

Conversation

@cnealen
Copy link
Copy Markdown
Contributor

@cnealen cnealen commented Apr 6, 2026

What changed

  • add --files and --dirs subcommands to parallel_works_scripts/cleanup_cluster.sh
  • add interactive confirmation before deletion runs
  • add a pre-delete preview so the target files or directories can be reviewed first

Why

  • make the cleanup flow more targeted when operators only want file or directory cleanup
  • reduce the chance of accidental deletion by showing what will be removed and requiring confirmation

Impact

  • users can run narrower cleanup operations from the existing script
  • destructive cleanup actions now have an extra safety step before execution

Validation

  • reviewed the branch diff and commit history for feat/cleanup-files-dirs-subcommands
  • branch pushed to origin/feat/cleanup-files-dirs-subcommands

cnealen added 2 commits April 3, 2026 08:38
--files: deletes files in a directory older than a cutoff date.
  nginx-unprivileged.sif is always protected. Supports --exclude
  (comma-separated), --path, --cutoff (YYYY-MM-DD), and --dry-run.

--dirs: deletes named subdirectories. Supports --path, --targets
  (comma-separated), and --dry-run. Warns to verify sessions are
  inactive before deleting job directories.
…dirs

Both subcommands now collect what they intend to delete, display the full
list, and require explicit y/N confirmation before any destructive action.
--dry-run skips the prompt and shows the same list without deleting.
--dirs also re-states the PW Sessions check warning at confirmation time.
@cnealen cnealen self-assigned this Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant