Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify copy function to compress payload #191

Open
vladimirvivien opened this issue Dec 17, 2020 · 1 comment · May be fixed by #201
Open

Modify copy function to compress payload #191

vladimirvivien opened this issue Dec 17, 2020 · 1 comment · May be fixed by #201

Comments

@vladimirvivien
Copy link
Contributor

Currently the copy command copy the specified file(s) to the local machine where crashd is running. As a crashd script writer, I should be able to have crashd copy and compress the file as it is being copied to save an extra step.

For instance:

copy(path="path/to/copy", format="gz")

The example above would copy the file from the remote machine and stream and gzipped it as it is downloaded.

@vladimirvivien
Copy link
Contributor Author

First attempt at implementing this was using the -C flag for SCP command. However, that flag compresses the network communication between client/server. The final downloaded file is uncompressed.

Workarounds:

  1. Continue to use SCP and compress file after it is copied locally (slow because file has to be downloaded first then compressed).
  2. Update capture(...) and change it to compress as file is stream from stdout from server (slow, since content has to stream over stdout, but compression can happen inline as file is streamed. So may be better then option 1).
  3. The best would be to do a Go implementation of SCP and compress io stream as it it received from server.

@vladimirvivien vladimirvivien linked a pull request Feb 23, 2021 that will close this issue
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 a pull request may close this issue.

1 participant