The module seems to make use of a "pipe" to write tugboat execution output through streams. This is seen here:

https://cgit.drupalcode.org/tugboat/tree/tugboat.module#n115

I'm proposing an optional parameter for a file path to to the "tugboat_execute" command to allow for the output to be routinely updating a text file as the command runs.

Comments

nerdstein created an issue. See original summary.

nerdstein’s picture

One "easy" thing to consider is just writing output to a passed file path.

https://cgit.drupalcode.org/tugboat/tree/tugboat.module#n123

if (!empty($file_path)) {
  $command .= ' 2>&1 | tee ' . $file_path;
}

I'm concerned how this might impact the other streams but I think testing is needed.

Approach motivated by https://askubuntu.com/questions/420981/how-do-i-save-terminal-output-to-...

nerdstein’s picture

In general, the approach "worked". But, it's not complete. So, I'll hold off on the patch.

The output generated is only the JSON response output from the command. The console output and/or errors are captured as other streams. Such things are also value for logging purposes.

This approach needs extended for both streams and output. I'm recommending three new, optional parameters for the file paths of stdout, errors, and the command output.

nerdstein’s picture

StatusFileSize
new1.81 KB
daggerhart’s picture

Status: Active » Reviewed & tested by the community

This looks reasonable to me. It's hard for me to know for sure without a way to test it, but what I am seeing in the patch looks right.

nerdstein’s picture

Status: Reviewed & tested by the community » Patch (to be ported)

Awesome, merging

  • nerdstein committed 9029683 on 7.x-1.x
    Issue #3044433 by nerdstein, daggerhart: Ability to write output to a...
nerdstein’s picture

Status: Patch (to be ported) » Fixed

Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.