copy file <from-file> to <to-file>
Copies a file or directory.
- The source file or directory.
- The destination file or directory.
Use this command to copy a file or directory to a destination.
This command is optimized for configuration files and directories in that command completion refers to the
/config directory of all known system images. For example,
running://config/ indicates the /config directory of the currently running system, and
test-image1://config/ indicates the
/config directory of an image called test-image1. If needed, however, any other location within the file system can be specified.
A file or directory can be copied on the local machine. Only a file can be copied to and from the remote machine by using FTP, SCP, or TFTP.
The following table shows how to specify different types of file locations.
|FTP server|| |
|SCP server|| |
|TFTP server|| |
|A binary image|
The following example shows how to copy the contents of the
/config/x509/ directory on the currently running system to the
/config/x509/ directory of the TEST-IMAGE-1 image.
vyatta@vyatta:~$ copy file running://config/auth/x509/ to TEST-vyatta@vyatta:~$/auth/x509/ sending incremental file list created directory /live/image/boot/TEST-IMAGE-1/live-rw/config/x509 ./ ca.crt 1265 100% 0.00kB/s 0:00:00 (xfer#1, to-check=5/7) crl.pem 568 100% 554.69kB/s 0:00:00 (xfer#2, to-check=4/7) key 5626 100% 5.37MB/s 0:00:00 (xfer#3, to-check=3/7) straylight-r1.crt 3632 100% 3.46MB/s 0:00:00 (xfer#4, to-check=2/7) straylight-r1.key 891 100% 870.12kB/s 0:00:00 (xfer#5, to-check=1/7) test.key 401 100% 391.60kB/s 0:00:00 (xfer#6, to-check=0/7) sent 12808 bytes received 129 bytes 25874.00 bytes/sec total size is 12383 speedup is 0.96 vyatta@vyatta:~$