Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hubcio/stdin2file
A kind of tee-like program which writes stdin to file, and optionally compresses it using multiple threads.
https://github.com/hubcio/stdin2file
cat compression stdin tee
Last synced: about 1 month ago
JSON representation
A kind of tee-like program which writes stdin to file, and optionally compresses it using multiple threads.
- Host: GitHub
- URL: https://github.com/hubcio/stdin2file
- Owner: hubcio
- Created: 2020-10-21T22:42:12.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2024-07-25T17:13:12.000Z (5 months ago)
- Last Synced: 2024-07-25T20:15:18.113Z (5 months ago)
- Topics: cat, compression, stdin, tee
- Language: Rust
- Homepage:
- Size: 54.7 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# stdin2file
A kind of tee-like program which writes stdin to file, and
optionally compresses it using multiple threads.## Installation
Archives of precompiled binaries are available for Linux.
Other way is to clone project and compile it yourself.
## Usage
```sh
stdin2file 1.2
hugruu
Write from stdin to file(s), optionally compresses it using given algorithmUSAGE:
stdin2file [OPTIONS] --chunk --outputOPTIONS:
-c, --chunk Maximum size of single file size [MB]
-e, --execute Command to execute (instead of stdin) - CURRENTLY UNSUPPORTED
-h, --help Print help information
-m, --max-files Number of rotated files
-o, --output Output file
-s, --compress Compression algorithm [possible values: xz, gz]
-V, --version Print version information
```## Examples
Copy stdin to 5 rotating files, each 1 MB before compression, and compress them:
```sh
command | stdin2file -c 1 -m 5 -o test -s xz
```Split 10 MiB text file using above settings:
```sh
base64 /dev/urandom | head -c 10000000 | stdin2file -c 1 -m 5 -o test -s xz
```This will result in 5 files:
```sh
$ ls -la
total 3600
-rw-rw-r-- 1 gruszeck gruszeck 806680 Feb 5 18:14 test.5.xz
-rw-rw-r-- 1 gruszeck gruszeck 806532 Feb 5 18:14 test.6.xz
-rw-rw-r-- 1 gruszeck gruszeck 806952 Feb 5 18:14 test.7.xz
-rw-rw-r-- 1 gruszeck gruszeck 806504 Feb 5 18:14 test.8.xz
-rw-rw-r-- 1 gruszeck gruszeck 433092 Feb 5 18:14 test.9.xz
```## Possible improvements
* Add support for lzma, gzip or other algorithms
* Pass command as argument instead of pipe
* Add pipeline## License
[https://en.wikipedia.org/wiki/WTFPL](https://en.wikipedia.org/wiki/WTFPL).