Supported Platforms
Related Documentation
- ACX, EX, M, MX, PTX, SRX, T Series
- Storing and Enabling Scripts
- Storing and Using Imported Scripts and Script Functionality
Storing Scripts in Flash Memory
By default, scripts are stored in and executed from the /var/db/scripts/
directory on the device's hard
drive under the subdirectory appropriate to the script type. To store
scripts in and load them from flash memory instead, include the load-scripts-from-flash statement at the [edit system scripts] hierarchy level:
When you add the load-scripts-from-flash statement
in the configuration, all commit, event, operation, and script library
scripts are loaded from the /config/scripts/
directory on the flash drive under the subdirectory appropriate
to the script type. You must manually move scripts from the hard drive
to the flash drive. They are not moved automatically. Similarly, if
you delete the load-scripts-from-flash statement from the
configuration, you must manually copy the scripts from the flash drive
to the hard drive to ensure that the current versions of the scripts
are executed. Changing the scripts’ physical location has no
effect on their operation.
The /var/run/scripts/
directory
always links to the directory from which the scripts are loaded. If
you do not set the load-scripts-from-flash statement in
the configuration, /var/run/scripts/
points to the /var/db/scripts/
directory
on the device’s hard drive. If you set the load-scripts-from-flash statement in the configuration, /var/run/scripts/
points to the /config/scripts/
directory
in flash memory.
To view the scripts currently on the device, list the
contents of /var/run/scripts/type/
, where type is the subdirectory
appropriate to the script type. In the following example, the load-scripts-from-flash statement is not configured. In this
case, /var/run/scripts/commit/
points
to the/var/db/scripts/commit/
directory
on the hard drive. Listing the files for /var/run/scripts/commit/
is identical to listing the files in the /var/db/scripts/commit/
directory.
user@host>file list /var/run/scripts/commit
/var/run/scripts/commit: commit-changes-load-replace.slax commit-protect.slax
user@host> file list /var/db/scripts/commit
/var/db/scripts/commit: commit-changes-load-replace.slax commit-protect.slax
user@host> file list /config/scripts/commit
/config/scripts/commit:
Related Documentation
- ACX, EX, M, MX, PTX, SRX, T Series
- Storing and Enabling Scripts
- Storing and Using Imported Scripts and Script Functionality
Published: 2013-03-05
Supported Platforms
Related Documentation
- ACX, EX, M, MX, PTX, SRX, T Series
- Storing and Enabling Scripts
- Storing and Using Imported Scripts and Script Functionality