Skip to content

How to copy binary data to stdout? #72

@guettli

Description

@guettli

I try to get a files or directories like this:

k node-shell mynode  -- tar -czf- /var/log/... > o.tgz

But this fails, because tar does not write to a tty:

tar: Refusing to write archive contents to terminal (missing -f option?)
tar: Error is not recoverable: exiting now

Is there a way to make node-shell not create a tty?

I tried this workaround:

k node-shell mynode  -- sh -c "tar -czf- /var/log/... |cat" > o.tgz

But this seems to alter the binary data slightly. Extracting it does not work:

gzip: stdin: invalid compressed data--format violated


It would be really great if output of binary data would be supported.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions