Skip to content

ezgh sandboxes cp

Copy a file to or from a sandbox.

Updated View as Markdown
ezgh sandboxes cp <source> <destination> [--mode 0644] [flags]

Copy one file to or from a sandbox. One side is <sandbox>:<absolute path>, the other a local path, or - for standard input (as the source) or standard output (as the destination). A suspended sandbox is resumed first.

To a sandbox, the file replaces what’s at the path, as the image’s user, with --mode (three octal digits, default 0644); a file is at most 5 GiB, and nothing is written unless all of it arrives. From a sandbox, a destination that is a directory gets the file under its own name, and the destination is only written once the whole file has arrived: a copy that ends early leaves what was there.

It copies one file. For a directory, send an archive through exec:

tar -C ./src -cf - . | ezgh sandboxes exec -i <sandbox> -- tar -C /srv -xf -

Part of ezgh sandboxes.

Examples

ezgh sandboxes cp ./config.json build:/srv/config.json
ezgh sandboxes cp build:/var/log/app.log .
ezgh sandboxes cp build:/srv/report.csv - | head

Flags

Flag Type Default Description
--mode string the file’s permissions in the sandbox, three octal digits (default 0644)

This command also takes the global flags.

Navigation

Type to search…

↑↓ navigate↵ selectEsc close