# Saving the Current Configuration

By default, the system automatically saves any change to the system configuration to nonvolatile storage (NVS). This feature is known as Automatic Commit mode, but has no effect on the CLI prompt. For more information about displaying the current configuration of the system while in Automatic Commit mode, see show configuration.

You can disable this feature by issuing the service manual-commit command. In Manual Commit mode (again with no effect on the CLI prompt), any configuration change affects only the current system configuration (the running configuration). For more information about displaying the running configuration of the system while in Manual Commit mode, see show running-configuration.

If you are in Manual Commit mode and want to save the configuration changes to NVS, you must issue either the write memory command or the copy running-configuration startup-configuration command.

If you change the configuration while in Manual Commit mode and issue the reload command without saving the changes to the startup configuration, the system provides a warning, allowing you to save the changes before reloading.

You can use the include-text-config keyword with the copy running-configuration command to add the text configuration to the system configuration file in compressed format. Storing the text configuration in compressed format reduces the size of the system configuration file and the amount of space that the file occupies on the local flash card or network host. If you change from commit mode to manual-commit mode, the configuration that is available at that point in time is written into the .cnf file. A Perl script is provided in the Tools folder of the software image bundle that you can download from the Juniper Networks website, depending on whether you want to install the software on an ERX model or an E120 and E320 model, shipped with your router that enables you to view the text configuration in a configuration file that contains both binary and text configuration. The Perl script supports multiple platforms. The “Usage and Troubleshooting document for desktop tool” file in PDF format provides an explanation of how to extract the system configuration file, using the extractScrFromCnf.pl script. For more information about using the Perl script, see Using the Desktop Tool for Viewing Uncompressed Text Configuration.

| Note: To avoid any discrepancies between the text-generated file and the system configuration file, do not change the configuration when the copy running-configuration command is running.

copy running-configuration

- Use to save the current configuration to a system configuration (*.cnf) file.
- Use the include-text-config keyword to add the text configuration to the system configuration file in compressed format.
- Although this command is available in either Automatic Commit mode or Manual Commit mode, use this command only in Manual Commit mode. Issuing this command in Automatic Commit mode has no effect.
- The destination filename must have a .cnf extension.
- The destination file can be either a local or a network file.
- If you want to restore a previously saved configuration, use the boot config cnfFileName command.
- Example 1—Saves the current configuration on the router to the system 2.cnf file
  host1#copy running-configuration system2.cnf
- Example 2—Saves the current configuration on the router to the system 2.cnf file and adds the text configuration to the system 2.cnf file in compressed format
  host1#copy running-configuration system2.cnf include-text-config
- There is no no version.
- See copy running-configuration.

copy running-configuration startup-configuration

- Use to save all outstanding (unsaved) configuration changes to NVS.
- This command is an exact alias of the write memory command.
- This command is available if the system is in either Automatic Commit mode or Manual Commit mode. If issued while in Automatic Commit mode, the CLI notifies you that the command is not necessary, but allows you to proceed.
- If automatic synchronization between the primary and standby SRP modules is enabled (the default system behavior) and the system is in Manual Commit mode (the nondefault system behavior), issuing this command triggers file system synchronization immediately after the system writes, or commits, all outstanding configuration changes to NVS.
- This command is prevented during the high availability initialization state. If issued during this state, the CLI notifies you of the state and requests that you try again later.
- Example
  host1#copy running-configuration startup-configuration
- There is no no version.
- See copy running-configuration startup-configuration.

copy startup-configuration

- Use to copy the previously saved startup configuration to a system configuration (*.cnf) file. If you have made but not saved any configuration changes, those changes are not in the startup configuration.
- This command is available only if the system is in Manual Commit mode.
- Example
  host1#copy startup-configuration system1.cnf
- There is no no version.
- See copy startup-configuration.

service manual-commit

- Use to stop the system from automatically saving configuration changes to NVS.
- Issuing this command places the system into Manual Commit mode. This mode has no effect on the CLI prompt.
- Issuing this command causes an immediate save of configuration data not yet committed to NVS.
- If issued when high availability is initializing, the CLI notifies you of the state and requests that you try again later.
- Example
  host1(config)#service manual-commit
- The no version returns the system to Automatic Commit mode; the no version has no effect if the system is already in Automatic Commit mode.
- See service manual-commit.

write memory

- Use to save all outstanding (unsaved) configuration changes to NVS.
- This command is an exact alias of the copy running-configuration startup-configuration command.
- This command is available if the router is in either Automatic Commit mode or Manual Commit mode. If issued while in Automatic Commit mode, the CLI notifies you that the command is not necessary, but allows you to proceed.
- If automatic synchronization between the primary and standby SRP modules is enabled (the default system behavior) and the system is in Manual Commit mode (the nondefault system behavior), issuing this command triggers file system synchronization immediately after the system writes, or commits, all outstanding configuration changes to NVS.
- Example
  host1#write memory
- There is no no version.
- See write memory.