The set save-configuration command enables automatic saving of configurations.
The undo set save-configuration command disables automatic saving of configurations.
set save-configuration [ interval interval | cpu-limit cpu-usage | delay delay-interval ] *
undo set save-configuration [ interval [ interval ] | cpu-limit [cpu-usage ] | delay [ delay-interval ] ]*
| Parameter | Description | Value |
|---|---|---|
interval interval |
Specifies the interval for saving configurations. |
The value is an integer ranging from 30 to 43200, in minutes. The default value is 30. |
cpu-limit cpu-usage |
Specifies the upper limit of the CPU usage. |
The value is an integer ranging from 1 to 60, in percentage. The default value is 50%. |
delay delay-interval |
Specifies a delay after which the system save configurations when the system configurations change. NOTE:
If a configuration change occurs within the configured delay time, the device restarts the timer. |
The value is an integer ranging from 1 to 60, in minutes. The default value is 5. The value of delay-interval must be smaller than the value of interval. |
By default, automatic saving of configurations is not enabled.
Application scenario
To prevent configuration file loss caused by device power-off or unexpected device restart, you can run this command to enable automatic saving of configurations.
If you do not run the set save-configuration command, the system does not automatically save configurations.
If you run the set save-configuration command, before periodically saving configurations, the system compares the configuration files. If the configurations do not change, the system does not periodically save them.
If you run the undo set save-configuration command, the system no longer automatically saves configurations. The undo set save-configuration command with a parameter (such as interval interval) specified restores the default value of the parameter and the automatic save function still takes effect.
In the execution of this command, if delay delay-interval is specified, the system automatically saves configurations after the specified delay time elapses.
Follow-up Procedure
You can run the display saved-configuration configuration command to check the configuration of the periodic saving function.
Precautions
The configuration file is being written.
The configurations of an LPU is being restored.
The CPU usage is high.
When the system is saving configurations automatically to an LPU that is not properly installed, the configurations may be lost.
# Configure the system to automatically save configurations at 60-minute intervals.
<sysname> system-view [sysname] set save-configuration interval 60
# Configure the system to save configurations at 10-hour intervals 3 minutes after the system configuration changes, and set the upper limit of the CPU usage to 60%.
<sysname> system-view [sysname] set save-configuration interval 600 delay 3 cpu-limit 60