request system scripts refresh-from
Syntax
request system scripts refresh-from (commit | event | extension-service | op | snmp) file filename url url cert-file path <routing-instance routing-instance-name> <sync>
Description
Refresh a local script from a remote source at the specified URL. The system uses the
script type to determine the directory on the device where the script resides. If you
include the sync
option, the system refreshes the script on the
requesting Routing Engine and then synchronizes the script on the other Routing Engine.
If the load-scripts-from-flash
statement is present in the
configuration for that Routing Engine, the system refreshes the script in flash memory.
Otherwise, the system refreshes the script on the hard disk.
If you specify an HTTPS URL, you must also include the cert-file
option
in supported releases. The cert-file
option specifies the path to the
certificate (Root CA or self-signed) that the device uses to validate the server's
certificate.
We do not recommend refreshing scripts from an HTTPS server when the device is unable to authenticate the server because malicious users could compromise the integrity of a script.
The Junos XML management protocol equivalent for this operational mode command is:
<request-script-refresh-from> <type>(commit | op | event | extension-service | snmp)</type> <file>filename</file> <url>url</url> <routing-instance>routing-instance-name</routing-instance> <cert-file>path</cert-file> <sync/> </request-script-refresh-from>
Options
(commit | event | extension-service | op | snmp) |
Specify in which scripts subdirectory the script resides: commit, event, jet, op, or snmp. |
cert-file path |
Absolute path to the certificate (Root CA or self-signed) in Privacy-Enhanced Mail (PEM) format that is used to validate the server's certificate when you specify an HTTPS URL. |
file filename |
Filename of the script to refresh. |
routing-instance routing-instance-name |
(Optional) Name of the routing instance through which you want to refresh the script. |
sync |
(Optional) Synchronize the refreshed script from the requesting Routing Engine to the other Routing Engine. |
url url |
URL of the file that will replace the script provided as an HTTPS URL, HTTP URL, FTP URL, or secure copy (scp)-style remote file specification. |
Required Privilege Level
maintenance
Sample Output
- request system scripts refresh-from
- request system scripts refresh-from
- request system scripts refresh-from sync
- request system scripts refresh-from cert-file
request system scripts refresh-from
The following command refreshes the op script config.slax from the remote source at the specified URL.
user@host> request system scripts refresh-from op file config.slax url http://host1.juniper.net/config.slax config.slax 100% 9 0.0KB/s 00:00
request system scripts refresh-from
The following command refreshes the op script config1.slax from the remote source at the specified URL. However, in this case, the script does not exist at the remote site, and the device generates an error message.
user@host> request system scripts refresh-from op file config1.slax url http://host1.juniper.net/config1.slax refreshing 'config1.slax' from 'http://host1.juniper.net/config1.slax' fetch-secure: http://host1.juniper.net/config1.slax: Not Found error: file-fetch failed error: communication error: rpc failed (file-fetch) error: error retrieving file http://host1.juniper.net/config1.slax
request system scripts refresh-from sync
The following command refreshes the op script config.slax on the requesting Routing Engine from the remote source at the specified URL. The system then synchronizes the updated script to the other Routing Engine.
user@host> request system scripts refresh-from op file config.slax url http://host1.juniper.net/config.slax sync config.slax 100% 9 0.0KB/s 00:00
request system scripts refresh-from cert-file
The following command refreshes the op script
ospf-neighbors.slax from the remote source at the HTTPS URL.
The command includes the cert-file
option, which references the Root
CA certificate file required to validate the server's certificate.
user@host> request system scripts refresh-from op file ospf-neighbors.slax url https://example.juniper.net/scripts/ospf-neighbors.slax cert-file /var/tmp/root-ca-cert-example-juniper-net.pem refreshing 'ospf-neighbors.slax' from 'https://example.juniper.net/scripts/ospf-neighbors.slax' /var/home/user/...transferring.file........100% of
Release Information
Command introduced in Junos OS Release 10.1.
sync
option introduced in Junos OS Release 13.2.
extension-service
and routing-instance
options
introduced in Junos OS Release 18.1R1.
cert-file
option introduced in Junos OS Release 21.2R1.