docs icon indicating copy to clipboard operation
docs copied to clipboard

Add mc pipe command to minio docs

Open bh4t opened this issue 3 years ago • 1 comments

Description and examples on mc pipe command is missing from minio docs.

Here is a summary from terminal.

NAME: mc pipe - stream STDIN to an object

USAGE: mc pipe [FLAGS] [TARGET]

FLAGS: --encrypt value encrypt objects (using server-side encryption with server managed keys) --storage-class value, --sc value set storage class for new object(s) on target --attr value add custom metadata for the object --tags value apply one or more tags to the uploaded objects --encrypt-key value encrypt/decrypt objects (using server-side encryption with customer provided keys) --config-dir value, -C value path to configuration folder (default: "/home/minio/.mc") --quiet, -q disable progress bar display --no-color disable color theme --json enable JSON lines formatted output --debug enable debug output --insecure disable SSL certificate verification --help, -h show help

ENVIRONMENT VARIABLES: MC_ENCRYPT: list of comma delimited prefix values MC_ENCRYPT_KEY: list of comma delimited prefix=secret values

EXAMPLES:

  1. Write contents of stdin to a file on local filesystem. $ mc pipe /tmp/hello-world.go

  2. Write contents of stdin to an object on Amazon S3 cloud storage. $ mc pipe s3/personalbuck/meeting-notes.txt

  3. Copy an ISO image to an object on Amazon S3 cloud storage. $ cat debian-8.2.iso | mc pipe s3/opensource-isos/gnuos.iso

  4. Stream MySQL database dump to Amazon S3 directly. $ mysqldump -u root -p ******* accountsdb | mc pipe s3/sql-backups/backups/accountsdb-oct-9-2015.sql

  5. Write contents of stdin to an object on Amazon S3 cloud storage and assign REDUCED_REDUNDANCY storage-class to the uploaded object. $ mc pipe --storage-class REDUCED_REDUNDANCY s3/personalbuck/meeting-notes.txt

  6. Copy to MinIO cloud storage with specified metadata, separated by ";" $ cat music.mp3 | mc pipe --attr "Cache-Control=max-age=90000,min-fresh=9000;Artist=Unknown" play/mybucket/music.mp3

  7. Set tags to the uploaded objects $ tar cvf - . | mc pipe --tags "category=prod&type=backup" play/mybucket/backup.tar

bh4t avatar Jul 26 '22 23:07 bh4t

I vaguely recall there being a reason we didn't document this...but I cannot remember what.

Given that, no reason not to proceed. We can use the standard template to add this to the docs.

ravindk89 avatar Jul 27 '22 16:07 ravindk89