Skip to content

feat: add output file management for per-node command results#2

Merged
inureyes merged 3 commits intomainfrom
feature/output-to-files
Aug 21, 2025
Merged

feat: add output file management for per-node command results#2
inureyes merged 3 commits intomainfrom
feature/output-to-files

Conversation

@inureyes
Copy link
Member

Summary

  • Implement output file management feature to save command results to separate files per node
  • Add --output-dir option to specify where to save outputs
  • Refactor execute_command to use parameter struct to fix clippy warnings

Changes

  • Save stdout and stderr to separate files per node with timestamped filenames
  • Create error files for failed connections or command executions
  • Generate empty marker files when commands produce no output
  • Create execution summary file with overall success/failure counts
  • Add metadata headers to all output files (command, host, user, exit status, timestamp)
  • Update documentation in README.md and manpage
  • Add chrono dependency for timestamp generation
  • Refactor execute_command function to use ExecuteCommandParams struct

File Structure

When using --output-dir, the following files are created:

output-dir/
├── hostname1_YYYYMMDD_HHMMSS.stdout   # Standard output
├── hostname1_YYYYMMDD_HHMMSS.stderr   # Standard error (if any)
├── hostname2_YYYYMMDD_HHMMSS.error    # Connection/execution errors
├── hostname3_YYYYMMDD_HHMMSS.empty    # Marker for no output
└── summary_YYYYMMDD_HHMMSS.txt        # Overall execution summary

Usage Example

bssh -c production --output-dir ./results "ps aux"

Test Plan

  • Tested output file creation with successful commands
  • Tested stderr capture for commands with error output
  • Tested empty file markers for commands with no output
  • Tested error file creation for failed connections
  • Verified summary file generation with correct counts

@inureyes inureyes self-assigned this Aug 21, 2025
@inureyes inureyes added type:enhancement New feature or request add labels Aug 21, 2025
@inureyes inureyes merged commit a2e4180 into main Aug 21, 2025
1 check passed
@inureyes inureyes added priority:medium Medium priority issue status:done Completed feature labels Sep 9, 2025
@inureyes inureyes removed the add label Oct 27, 2025
@inureyes inureyes deleted the feature/output-to-files branch October 30, 2025 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority:medium Medium priority issue status:done Completed type:enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant