I want to reliably move a large file from one computer to another, where it must be processed before saving.
I thought of transferring the file to ssh by executing a script processing.
local.example.com$ cat file | ssh remote.example.com process.sh
(If you have an idea better than mine, please suggest)
In the script process, I want both checksums and encrypt the file before saving. And here a problem arises.
Solutions can be two:
- pipe input into two commands (cksum and openssl); but all the paths that I found looked complicated and optional.
hack cksum also does work with the cat and prints the result to stderr so that I can do
cksum --pipe | openssl enc > myfile
and return the checksum via stderr. Unfortunately, I looked at the code, and it seems to me that this is difficult to do without sacrificing performance / buffering;)
, cksumming, , .
.
.
: http://www.linuxjournal.com/content/shell-process-redirection