save

Function

The save command saves all configurations to a storage device.

Format

save [ configuration-file ]

Parameters

Parameter Description Value
configuration-file

Specifies the name of a configuration file.

The value is a string of 5 to 64 characters in the format of .zip, .cfg, or .dat.

Views

User view

Default Level

2: Configuration level

Task Name and Operations

Task Name Operations
config write

Usage Guidelines

Usage Scenario

  • When a series of configurations are complete and take effect, all configuration files must be saved to the storage device.
  • You can run the command in the user view without specifying the configuration-file parameter, because the system saves all configurations to the next-startup configuration file by default. If no next-startup configuration file exists, the system prompts you to determine whether to save configurations to the vrpcfg.zip file. You can save configurations to the file or specify another file for saving the configurations. Then the specified file is configured as the next-startup configuration file. To check the name of the next-startup configuration file, run the display startup command.
  • The save configuration-file command in the user view backs up all configurations to a specified file on the storage device. This command does not affect the current startup configuration file. If the storage path and name of the configuration file specified using configuration-file are the same as those of the next-startup configuration file, the save configuration-file command functions the same as the save command.
  • If you save the configuration file for the first time in the user view without specifying the configuration-file parameter, the system prompts you to determine whether to name the configuration file vrpcfg.zip. The vrpcfg.zip file is the default configuration file with empty configuration.
  • If the save command is run by a configuration-level user, the configuration file is only saved to the root directory.

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.

Example

# Save all configurations to the next startup configuration file.
<HUAWEI> save
Warning: all configuration will be written to the device.
Are you sure to continue?[Y/N]y
Now saving all configuration to the slot 1
Info: Save the configuration successfully.
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >