Usage Scenario
- When a series of configurations are complete and take effect, all configuration files must be saved to the storage device.
- If you run the command in a non-user view, the configuration-file parameter must be specified and the file name extension must be .zip or .cfg.
- The save command run in the system view to save the configuration file functions the same as the save command run in the user view. All device configurations are saved, and the saved file can be specified as the next-startup configuration file, no matter you run the command in which of the views. If you run the command in the system view, the configuration-file parameter must be specified, and the file name extension must be .zip or .cfg. If you run the command in a sub-view of the system view, only the configuration in the current sub-view is saved.
- If you run the command in a non-user view, only the configuration in the current view is saved to the specified configuration file. This configuration file is used as the source file to be loaded using the load configuration replace command in a configuration replacement scenario.
Configuration Impact
When you run the save command several times, the latest configuration overrides the previous configuration. If the file of the same name already exists, the contents of the original file are changed.
Running this command causes a temporary high CPU usage, but services are not affected.
Precautions
- A configuration file can contain only configuration commands, view switching commands, and # symbols (used to switch to the system view). If you load other types of commands, such as display commands used for query, reset/save/ping commands used for maintenance, quit, return, and upgrade-compatible commands, the device reports an error and continues the loading of follow-up commands.
- Repeated commands cannot coexist in the same view.
- Command lines must be indented correctly. Specifically, a command line in the current view must be indented by one character compared with a command line in the previous view.
- If the pound sign (#) is left-aligned, the system view is displayed. If the pound sign (#) is indented, it is used only to isolate command blocks; in this case, the pound sign (#) must be aligned with the first command in the following command block. If the pound sign (#) is incorrectly used, configurations may be lost, or commands may be run in an unexpected view.
- The configuration for entering a command view must be present. Otherwise, no commands can be executed in the command view.
- The command execution sequence and dependency must be correct.
- Interactive commands in the configuration file only support automatic interaction in Y/N mode, the default is Y.
- The extension of the configuration file name must be .zip, .cfg or .dat. The system configuration file must be saved in the root directory of the storage device.
- A .cfg file is a text file. You can directly view the content of a .cfg file. After a .cfg file is specified as the configuration file, the system restores the commands in the file one by one when startup.
- A .zip file is the compression of a .cfg file, occupying less space. After a .zip file is specified as the configuration file, the system decompresses the file into a .cfg file, and then restores the commands in the file one by one when startup.
- A .dat file is a binary file. If the startup software version and the .dat file version are the same, the system restores all configurations in the .dat file in batches when the device starts. This speeds up the system startup.