[Contents] [Prev] [Next] [Index] [Report an Error]

Refreshing Commit Script Files

You can refresh local commit scripts with remote commit scripts using the refresh and the refresh-from statements. You specify the remote commit script’s URL when issuing refresh-from statement. When you issue the refresh statement, the router uses the commit script URL specified by the source statement. For more information on the source statement and defining a master commit script source URL, see Specifying a Remote Commit Script Source URL.

Once the refresh or the refresh-from statement is issued, the router attempts to connect to the remote commit script source and retrieve the remote commit script. If successful, the router updates the local commit script. If a problem occurs, a set of error messages is returned.

The refresh operation occurs as soon as you add the refresh or refresh-from statement to the configuration. In this way, these statements behave like operational mode commands. Further, these statements are not permanently recorded in the configuration file.

If a platform has dual Routing Engines, you need to refresh the commit scripts on both Routing Engines. The commit synchronize command does not refresh the commit scripts between Routing Engines.

Caution: We recommend that you do not automate the refresh function by including the refresh statement as a commit script change element. Even though this might seem like a good way to ensure that the most current commit script is always used, we recommend against automating the refresh function for the following reasons:

  • Automated refresh means that the network must be in operation in order to successfully commit a configuration. If the network goes down after you make a configuration error, you cannot recover quickly.
  • If the software must refresh multiple commit scripts for each commit operation, the network response time can slow down.
  • If you automate the refresh operation, the script refresh is the last action in the current commit operation. Consequently, the updated commit script takes effect only for the subsequent commit operation. This is because commit scripts are applied to the candidate configuration before the software copies any persistent changes generated by the scripts to the candidate configuration. For more information, see Commit Scripts and the JUNOS Software Commit Model. In contrast, if you perform a refresh operation manually, the updated commit script takes effect as expected, that is, immediately after your commit the refresh statement in the configuration.
  • If you automate the refresh operation, the refresh-from statement has no effect, because the refresh-from URL conflicts with and is overridden by the source statement URL. For information about the refresh-from statement, see Refreshing the Local Commit Script.

 

Using the refresh-from Statement on a Single Commit Script

To refresh a single commit script, include the refresh-from statement at the [edit system scripts commit file filename] hierarchy level:

[edit system scripts commit file filename]
refresh-from url;

Specify the source as an HTTP URL, FTP URL, or Secure Copy Protocol (SCP)–style remote file specification.

The refresh operation occurs as soon as you include the refresh-from statement in the configuration and issue the commit command. The refresh-from statement is not carried in the configuration file. In this way, it behaves like an operational mode command.

Using the refresh-from Statement Globally

To refresh all scripts from a specified source, Include the refresh-from statement at the [edit system scripts commit] hierarchy level:

[edit system scripts commit]
refresh-from url;

Once the statement has been issued, the router will attempt to connect to the commit script source and retrieve the remote commit script files.

Using the refresh Statement on a Single Commit Script

To refresh a single commit script, issue the refresh statement at the [edit system scripts commit file filename] hierarchy level:

[edit system scripts commit]
set file filename refresh;
[edit system scripts commit file filename]
source http://my.example.com/pub/scripts/iso.xsl;

Once the statement has been issued, the router attempts to connect to the commit script source and retrieve the remote commit script file.

Using the refresh Statement Globally

To refresh all scripts from their sources issue the refresh statement at the [edit system scripts commit] hierarchy level:

[edit system scripts commit]
set refresh

Once the statement has been issued, the router attempts to connect to the commit script source and retrieve all remote commit script files.


[Contents] [Prev] [Next] [Index] [Report an Error]