./uplink.exe cp [flags] <SOURCE> <DESTINATION>
uplink cp [flags] <SOURCE> <DESTINATION>
uplink cp [flags] <SOURCE> <DESTINATION>
The cp
command is used to upload and download objects. The cp
command abstracts the complexity of encryption, erasure coding and distributing pieces of a file to storage nodes.
Flag | Description |
| the serialized access, or name of the access to use |
| optional expiration date of an object.
Please use format ( |
| help for cp |
| optional metadata for the object. Please use a single level JSON object of string to string only |
| if true, show progress (default true) |
When the cp
command is used to copy a file to the Tardigrade Platform (upload), the CLI first encrypts the file client-side, then splits it into a minimum of 80 erasure coded pieces, and finally the 80 pieces are uploaded in parallel to 80 different storage nodes.
To copy cheesecake.jpg
into the existing bucket cakes
, use the following command:
./uplink.exe cp cheesecake.jpg sj://cakes
uplink cp cheesecake.jpg sj://cakes
uplink cp cheesecake.jpg sj://cakes
You cannot use regular expressions to specify which files to copy (e.g. uplink cp cheese* sj://cakes
will not work). Also, you can only specify one source at a time (no )uplink cp cheesecake.jpg cheesecake.png sj://cakes
Output:
When the cp
command is used to copy a file from the Tardigrade Platform (download), the CLI first downloads the minimum number of pieces to reconstitute a file (typically 29 pieces), then re-encodes the pieces into a single file, and finally decrypts the file client-side.
To copy a file from a project to a local drive, use:
./uplink.exe cp sj://cakes/cheesecake.jpg ~/Downloads/
uplink cp sj://cakes/cheesecake.jpg ~/Downloads/
uplink cp sj://cakes/cheesecake.jpg ~/Downloads/
The uploaded object can be set to expire at a certain time. After the expiration date, the file is no longer available and no longer will generate usage charges. To set an expiration date for a file when uploading it, you should use the cp
command with the --expires
flag:
./uplink.exe cp cheesecake.jpg --expires 2021-12-31T13:00:00+02:00 sj://cakes
uplink cp cheesecake.jpg --expires 2021-12-31T13:00:00+02:00 sj://cakes
uplink cp cheesecake.jpg --expires 2021-12-31T13:00:00+02:00 sj://cakes
The date is given in the yyyy-mm-ddThh:mm:ssZhh:mm
format defined in ISO 8601. 2021-12-31T13:00:00+02:00
reads "December, 31st at 1pm UTC+2". A date ending with "Z", such as 2021-12-31T13:00:00Z
, is in UTC.
The command above gives the following output:
You can include metadata when uploading your file using the --metadata flag. These metadata are provided in JSON format.
You must use a single level JSON object of string to string only (e.g. '{"key1":"value1", "key2": "value2"'}
For example, to include an information about the baker of a cheesecake and the author of the pic:
./uplink.exe cp cheesecake.jpg sj://cakes --metadata '{\"baker\":\"cheeseman\", \"picture_author\": \"picman\"}'
uplink cp cheesecake.jpg sj://cakes --metadata '{"baker":"cheeseman", "picture_author": "picman"}'
uplink cp cheesecake.jpg sj://cakes --metadata '{"baker":"cheeseman", "picture_author": "picman"}'
You can retrieve these metadata using the meta get
command.