Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Announcement: Try the Ask AI chatbot for answers to your technical questions about Juniper products and solutions.

close
header-navigation
keyboard_arrow_up
close
keyboard_arrow_left
Automation Scripting User Guide
Table of Contents Expand all
list Table of Contents
file_download PDF
{ "lLangCode": "en", "lName": "English", "lCountryCode": "us", "transcode": "en_US" }
English
keyboard_arrow_right

Remove a Persistent or Transient Configuration Change Using Commit Scripts

date_range 14-Jul-21

After a commit script changes the configuration, you can remove the change and return the configuration to its previous state.

For persistent changes only, you can undo the configuration change by issuing the delete, deactivate, or rollback configuration mode command and committing the configuration. For both persistent and transient changes, you must remove, delete, or deactivate the associated commit script, or else the commit script regenerates the change during a subsequent commit operation.

Deleting the file filename statement from the configuration effectively disables the functionality associated with the corresponding commit script. Deactivating the statement adds the inactive: tag to the statement, effectively commenting out the statement from the configuration. Statements marked as inactive do not take effect when you issue the commit command.

To reverse the effect of a commit script and prevent the script from running again:

  1. For persistent changes only, delete or deactivate the statement that was added by the commit script:
    content_copy zoom_out_map
    [edit]
    user@host# delete (statement | identifier)
    - OR –
    user@host# deactivate (statement | identifier)
    

    Alternatively, you can roll back the configuration to a candidate that does not contain the statement.

    content_copy zoom_out_map
    [edit]
    user@host# rollback number
    
  2. Either delete or deactivate the commit script, or remove or comment out the section of code that generates the unwanted change. To delete or deactivate the script, issue one of the following commands.
    content_copy zoom_out_map
    [edit]
    user@host# delete system scripts commit file filename
    - OR –
    user@host# deactivate system scripts commit file filename
    
  3. Commit the configuration.
    content_copy zoom_out_map
    [edit]
    user@host# commit
    
  4. If you are deleting the reference to the script from the configuration, you can also remove the file from commit scripts storage directory (either /var/db/scripts/commit on the hard disk or /config/scripts/commit on the flash drive. To do this, exit configuration mode and issue the file delete operational mode command:
    content_copy zoom_out_map
    [edit]
    user@host# exit
    
    content_copy zoom_out_map
    user@host> file delete /var/db/scripts/commit/filename
     
    - OR –
     
    user@host> file delete /config/scripts/commit/filename
    
footer-navigation