< Home

set save-configuration

Function

The set save-configuration command enables automatic saving of configurations.

The undo set save-configuration command disables automatic saving of configurations.

Format

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 ] ]*

Parameters

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.

Views

System view

Default Level

3: Management level

Usage Guidelines

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 need to specify the interval for saving configurations, specify the interval interval parameter. If certain configurations are changed but not saved, the system saves the current configurations; otherwise, the system does not save the configurations. After the automatic saving function is enabled, the default interval is 30 minutes.
  • To prevent system performance from being compromised by automatic saving, you can set cpu-limit cpu-usage to specify the upper limit on the CPU usage during automatic saving. If the automatic saving timer is triggered, and the system detects that the CPU usage of the system is higher than the set value, the system cancels the automatic saving of this time. The default upper limit of the CPU usage is 50% for the automatic saving function.
  • If you specify delay delay-interval, the system saves the changed configurations after the specified delay. The default value is 5 minutes.

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

Before periodic saving of the configuration file, the system checks the configuration file. If the following conditions are met, periodic saving is triggered:
  • The configuration file is different from that saved last time.
  • The configuration file is the same as that saved last time, but changes have been made. For example, after a command is executed and then deleted, although the configuration file remains the same, periodic saving is also triggered.
After the automatic saving function is configured, the configuration file is saved in the configuration file for the next startup. The contents of the configuration file vary according to the configuration changes. When any of the following situations occurs, the system cancels periodic saving of the configuration file:
  • 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.

Example

# 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
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >