save
Saves the running configuration to a file.
- file-name
- The name of a file in which the information is to be saved, including the path to the file.
Configuration mode
Use this command to save the running configuration to a file.
The resulting file can later be loaded into the running system to replace the previous running configuration by using load. A nonabsolute path is interpreted relative to the default configuration directory, which is /config.
The following table shows how to specify the syntax for files from different file locations.
Location | Specification |
---|---|
An absolute path |
Use standard UNIX file specification. |
A relative path |
Specify the path name relative to the default configuration directory. |
FTP server |
Use the following syntax for file-name: ftp://user:passwd@host /config-file where user is the username on the host, passwd is the password associated with the username, host is the host name or IP address of the FTP server, and config-file is the configuration file, including the path. If you do not specify user and passwd, you are prompted for them. |
SCP server |
Use the following syntax for file-name: scp://user:passwd@host /config-file where user is the username on the host, passwd is the password associated with the username, host is the host name or IP address of the SCP server, and config-file is the configuration file, including the path. If you do not specify user and passwd, you are prompted for them. |
HTTP server |
Use the following syntax for file-name: http://host /config-file where host is the host name or IP address of the HTTP server, and config-file is the configuration file, including the path. |
TFTP server |
Use the following syntax for file-name: tftp://host /config-file where host is the host name or IP address of the TFTP server, and config-file is the configuration file, including the path relative to the TFTP root directory. |
If you overwrite a configuration file, the system retains one backup, using a file-name~ convention. For example, if you write over my-config.boot, the system moves the previous file to my-config.boot~.
Note that the save command writes only committed changes. If you make configuration changes and try to save them, the system warns you that you have uncommitted changes and then saves only the committed changes.
The following example shows how to save the running configuration to the my-config file in the default configuration directory, exit configuration mode, and display the set of files stored in the configuration directory.
vyatta@vyatta# save my-config
Saving configuration to '/config/my-config'...
Done
vyatta@vyatta# exit
vyatta@vyatta# show files /config
total 24K
-rw-rw-r-- 1 Vyatta xorp 2.8K Nov 28 10:30 config.boot
-rw-rw-r-- 1 Vyatta xorp 2.8K Nov 27 14:32 config.boot~
-rw-rw-r-- 1 Vyatta xorp 2.8K Nov 28 10:30 my-config
-rw-rw-r-- 1 Vyatta xorp 2.8K Nov 27 21:50 my-config~
vyatta@vyatta:~$
The following example shows how to save the current running configuration to the my-config file in the root directory of a TFTP server at 10.1.0.35.
vyatta@vyatta# save tftp://10.1.0.35/my-config
Saving configuration to 'tftp://10.1.0.35/my-config'...
Done
vyatta@vyatta#