mc get
Themc get command retrieves objects from an AIStor deployment or S3-compatible service to a local filesystem.
mc get provides a simplified interface for downloading files compared tomc cp ormc mirror.mc get uses a one-way download function that trades efficiency for the power and complexity of the other commands.
The following command downloads an object from themyaistor deployment to the local filesystem:
mc get myaistor/mybucket/myobject.txt ~/Downloads/Themc get command has the following syntax:
mc[GLOBALFLAGS] get\ SOURCE\ TARGET\[--enc-c string]\[--version-id| --vid value]- Brackets
[]indicate optional parameters. - Parameters sharing a line are mutually dependent.
- Parameters separated using the pipe
|operator are mutually exclusive.
Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.
Required
The full path to thealias, bucket, prefix (if used), and object to download.
Required
The destination path on the local file system where the command should place the downloaded file.
Optional
Encrypt or decrypt objects using server-sideSSE-C encryption with client-managed keys.
The parameter accepts a key-value pair formatted asKEY=VALUE
KEY- The full path to the object asalias/bucket/path/object.ext.You can specify only the top-level path to use a single encryption key for all operations in that path.
VALUE- Specify either a 32-byte RawBase64-encoded keyor a 64-byte hex-encoded key for use with SSE-C encryption.Raw Base64 encodingrejects
=-padded keys.Omit the padding or use a Base64 encoder that supports RAW formatting.
For example:
# RawBase64-Encoded string "mybucket32byteencryptionkeyssec"--enc-c"myaistor/mybucket/prefix/object.obj=bXlidWNrZXQzMmJ5dGVlbmNyeXB0aW9ua2V5c3NlYwo"You can specify multiple encryption keys by repeating the parameter.
Specify the path to a prefix to apply encryption to all matching objects at that path:
--enc-c"myaistor/mybucket/prefix/=bXlidWNrZXQzMmJ5dGVlbmNyeXB0aW9ua2V5c3NlYwo"--enc-kms or SSE-S3 via--enc-s3 parameters instead.Alias: --vid
Optional
Retrieve a specific version of the object.Pass the version ID of the object to retrieve.
This command supports any of theglobal flags.
The following command retrieves the filemyobject.csv from the bucketmybucket at the aliasmyaistor and places it on the local file system at the path/my/local/folder.
mc get myaistor/mybucket/myobject.csv /my/local/folderThe following command retrieves an encrypted file and places it at a local folder path.
mc get --enc-c"play/mybucket/object=MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTIzNDU2Nzg5MDA" play/mybucket/object path-to/object