Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 

Understanding Script Synchronization Between Routing Engines

 

Starting in Junos OS Release 13.2, you can manually synchronize commit, event, lib, op, and SNMP scripts between Routing Engines on a device running Junos OS or configure the device to automatically synchronize scripts between Routing Engines when you commit and synchronize the configuration. When invoked, the device synchronizes the scripts from the Routing Engine on which you execute the request (the requesting Routing Engine) to the other Routing Engine (the responding Routing Engine).

In operational mode, you can manually synchronize scripts from the requesting Routing Engine to the responding Routing Engine using the request system scripts synchronize command. The command enables you to customize the scope of the synchronization. You can synchronize a single script, all scripts of a specific type, or all scripts on the device. You also have the option to synchronize scripts based on filename or on the timestamp of the file.

In configuration mode, you have the option to synchronize all scripts when you commit and synchronize the configuration. To synchronize scripts on a per-commit basis, use the commit synchronize scripts command when you commit and synchronize the configuration. Alternatively, you can configure the device to automatically synchronize scripts from the requesting Routing Engine to the responding Routing Engine every time you issue a commit synchronize command. To ensure that scripts are copied from the requesting Routing Engine to the responding Routing Engine during a commit synchronize operation, configure the synchronize statement at the [edit system scripts] hierarchy level.

When you synchronize the configuration and scripts, the device:

  1. Performs a commit check on the requesting Routing Engine

  2. Synchronizes scripts to the responding Routing Engine

  3. Synchronizes the configuration to the responding Routing Engine

  4. Performs a commit check on the responding Routing Engine

  5. Commits the configuration on the responding Routing Engine

  6. Commits the configuration on the requesting Routing Engine

This process ensures that any commit scripts that are required for a successful commit operation are present on the responding Routing Engine before committing the configuration. If the commit check operation fails for the requesting Routing Engine, the process stops, and the scripts are not copied to the responding Routing Engine. If the commit check or commit operation fails for the responding Routing Engine, the scripts are still synchronized since the synchronization occurs prior to the commit check operation on the responding Routing Engine.

When synchronizing scripts, the device running Junos OS determines the script source and destination directories based on whether the load-scripts-from-flash statement is present in the configuration for each Routing Engine. If the load-scripts-from-flash statement is configured for the requesting Routing Engine, the device synchronizes the scripts that are in flash memory. Otherwise, the device synchronizes the scripts that are on the hard disk. If the load-scripts-from-flash statement is present in the final configuration for the responding Routing Engine, the scripts are synchronized to flash memory. Otherwise, the scripts are synchronized to the hard disk. The device synchronizes a script regardless of whether it is enabled in the configuration or has been updated since the last synchronization.

The request system scripts refresh-from operational mode command enables you to manually refresh a single script from a remote URL. Starting in Junos OS Release 13.2, you can synchronize the updated script to the other Routing Engine at the same time by including the sync option when you execute the command. When you execute the command, if the load-scripts-from-flash statement is configured on the Routing Engine, the script is refreshed in flash memory. Otherwise, the script is refreshed on the hard disk.