Managing Files
You are responsible for file management. Table 31 shows the types of system files and their corresponding extensions.
System files may reside in four locations:
The system space contains files for system operation. For example, the current software configuration is stored in the system space.
The user space is reserved for FTP server operations and has the typical directory structure of a secure FTP server. The root or top level directory is a read-only directory that contains two subdirectories:
- /incomingRead-write directory to and from which an FTP client can send and retrieve files.
- /outgoingRead-only directory from which an FTP client can retrieve files.
Users can transfer files through FTP to the user space from a network host and vice versa. However, users cannot access the system space through FTP. To install a file from the user space to the system space, use the copy command. For detailed information about transferring files between locations, see Transferring Files.
To conserve NVS and minimize the installation time, files are not stored in both the system space and the user space. When you issue the copy command to install a file from user space to system space, the E-series router establishes a link to the file, but does not make a physical copy.
Managing the User Space from a Network Host
If you enable the system's FTP server (see Configuring the FTP Server), you can manage files on the user space from an FTP client on a network host. Table 32 lists the FTP protocol commands that the E-series router supports. Whether you can perform these functions on the user space depends on the features that the FTP client offers.
Change file structure settings (only stream mode supported).
File Commands and FTP Servers
Commandscopy, configure file, and macrothat invoke a remote FTP server take place in the context of the current virtual router rather than the default virtual router. You must configure the remote FTP server so that any traffic destined for the virtual router can reach the virtual router; typically, you configure the FTP server to reach the default address of the system, which will always be able to reach the virtual router.
Renaming Files
To rename files, use the rename command. Table 33 shows the types of files you can rename in different locations.
rename
host1#rename boston1.cnf boston2.cnfThere is no no version.
Deleting Files
Use the delete command to delete files in NVS. Table 34 shows the types of files you can delete in different locations.
delete
- Use to delete files in NVS.
- To delete a file in user space, specify the incoming or outgoing directory on the FTP server. You can specify the name of a subdirectory in the incoming or outgoing directory.
- You can include an asterisk (*) as a wildcard at any position in a specified filename. The asterisk substitutes for zero or more characters in the name. You cannot use an asterisk in a directory or subdirectory name.
- You cannot delete reboot.hty or system.log files when you use a wildcard.
- When you do not use a wildcard, the CLI deletes the file immediately without prompting you for confirmation. When you use a wildcard, the CLI prompts you for confirmation unless you also specify the force keyword; in that case the deletion takes place without confirmation.
- The force keyword causes the immediate deletion of the directory or file even when it is not empty. However, if a file in the specified directory, or a specified file, is marked by the file system as in use because it is required for the current operation or configuration, the force keyword cannot force the deletion.
- The force keyword is ignored when you attempt to delete any .dmp or .tsa file (unless the deletion is issued from a .mac or .scr file); this means that the CLI always prompts for confirmation for these file types.
- Examples
host1#delete test-2.txthost1#host1#del test*.txtDelete disk0:test-1.txt? [confirm] -> press ndisk0:test-1.txt: not deleted (per user request)Delete disk0:test-2.txt? [confirm] -> press ydisk0:test-2.dmp: DeletedDeleted 1 file, matched 2 fileshost1#del test*.txt forcedisk0:test-1.txt: deleteddisk0:test-2.txt: deletedDeleted 2 files, matched 2 fileshost1#del *.dmp forceWARNING: The force option is ignored for this file type.Delete disk0:sample-1.dmp? [confirm] -> press ndisk0:sample-1.dmp: not deleted (per user request)Delete disk0:sample-2.dmp? [confirm] -> press ydisk0:sample-2.dmp: DeletedDeleted 1 file, matched 2 fileshost1#delete /outgoing/test.scrThere is no no version.
Monitoring Files
Use the dir command to view files in NVS.
dir
- Use to show a list of files in NVS.
- Specify a directory path, a local filename, a local device name, or some combination of these to view any local files or directories. You canot use the dir command on a network device.
- You can include an asterisk (*) at any position in a specified filename as a wildcard. The asterisk substitutes for zero or more characters in the name. You cannot use a wildcard in a path.
- Bulk statistics .sts files are stored in volatile storage on a RAM disk, and are displayed only when bulkstats is configured.
NOTE: When you issue the dir command from Boot mode, a reduced set of file types is displayed.
- Field descriptions
- fileName of file or directory (DIR indicates a directory)
- sizePhysical size of file
- unshared sizeSize of file in user space
- Value of zero indicates that this file has been installed onto the system space and that there is a link to this file.
- Value other than zero indicates that the file has not been installed onto the system space and equals the physical size of the file.
- dateDate that file was created
- in useAn exclamation point (!) indicates that the system is using this file
host1#dirPlease wait.....Active/standby file systems are synchronized.unsharedfile size size------------------------------------------------ --------- ---------disk0:/incoming <DIR> 0disk0:/outgoing <DIR> 0disk0:810beta13.cnf 280944 280944disk0:800beta12.cnf 327011 327011disk0:bng___1.txt 11092 11092disk0:bng___2.txt 11092 11092disk0:bng___3.txt 11092 11092disk0:erx701rel.cnf 255400 255400disk0:730beta19.cnf 283141 283141disk0:730beta18.cnf 284503 284503disk0:erx_8-0-0b0-24.cnf 327404 327404disk0:7.3run.cnf 301635 301635disk0:80beta_bce_backup.cnf 333228 333228disk0:800beta5.cnf 300575 300575disk0:820beta5.cnf 311616 311616disk0:810beta16.cnf 297764 297764disk0:SRP-10Ge_3_SC_08_22_2006_07_39.dmp 153268924 153268924disk0:SRP-10Ge_3_SC_04_12_2007_09_47.dmp 182385184 182385184disk0:reboot.hty 402368 402368disk0:system.log 702 702disk0:erx_9-0-0a1-7.rel 176128192 160912356disk0:erx_8-1-0b1-2.rel 164065212 148633854disk0:erx_8-2-0b1-5.rel 166117319 150685961disk0:testing_cat.txt 21848 21848standby-disk0:SRP-10Ge_1_SC_08_21_2006_13_48.dmp 153547479 153547479standby-disk0:SRP-10Ge_1_SC_04_12_2007_10_04.dmp 194849368 194849368standby-disk0:reboot.hty 123136 123136standby-disk0:system.log 855 855infile date (UTC) use------------------------------------------------ ------------------- ---disk0:/incoming <DIR> 02/08/2008 15:06:42disk0:/outgoing <DIR> 02/08/2008 15:06:42disk0:810beta13.cnf 02/06/2007 15:13:44disk0:800beta12.cnf 09/29/2006 16:31:54disk0:bng___1.txt 02/12/2008 07:05:20disk0:bng___2.txt 02/12/2008 07:05:28disk0:bng___3.txt 02/12/2008 06:59:46disk0:erx701rel.cnf 10/07/2005 13:01:02disk0:730beta19.cnf 07/12/2006 07:21:22disk0:730beta18.cnf 06/19/2006 15:23:46disk0:erx_8-0-0b0-24.cnf 11/02/2006 12:23:38disk0:7.3run.cnf 08/21/2006 11:19:52disk0:80beta_bce_backup.cnf 10/04/2007 09:01:36disk0:800beta5.cnf 01/02/2007 16:01:36disk0:820beta5.cnf 05/09/2007 14:29:58disk0:810beta16.cnf 03/15/2007 06:58:14disk0:SRP-10Ge_3_SC_08_22_2006_07_39.dmp 08/22/2006 07:43:14disk0:SRP-10Ge_3_SC_04_12_2007_09_47.dmp 04/12/2007 09:51:08disk0:reboot.hty 01/09/2008 13:57:02disk0:system.log 11/12/2007 09:56:14disk0:erx_9-0-0a1-7.rel 10/04/2007 08:40:06 !disk0:erx_8-1-0b1-2.rel 03/15/2007 06:50:32disk0:erx_8-2-0b1-5.rel 05/09/2007 14:22:22disk0:testing_cat.txt 03/13/2006 17:42:12standby-disk0:SRP-10Ge_1_SC_08_21_2006_13_48.dmp 08/21/2006 13:51:42standby-disk0:SRP-10Ge_1_SC_04_12_2007_10_04.dmp 04/12/2007 10:08:38standby-disk0:reboot.hty 01/09/2008 13:53:10standby-disk0:system.log 04/12/2007 09:47:24Disk capacity-------------Capacity Free ReservedDevice (bytes) (bytes) (bytes)-------------- ---------- --------- --------disk0: 1054900224 167372414 68157440standby-disk0: 1054900224 153330775 68157440Example 2 host1#dir *.txtPlease wait.....Active/standby file systems are synchronized.unsharedfile size size------------------------------------------------ --------- ---------disk0:bng___1.txt 11092 11092disk0:bng___2.txt 11092 11092disk0:bng___3.txt 11092 11092infile date (UTC) use------------------------------------------------ ------------------- ---disk0:bng___1.txt 02/12/2008 07:05:20disk0:bng___2.txt 02/12/2008 07:05:28disk0:bng___3.txt 02/12/2008 06:59:46Disk capacity-------------Capacity Free ReservedDevice (bytes) (bytes) (bytes)-------------- ---------- --------- --------disk0: 1054900224 167372414 68157440standby-disk0: 1054900224 153330775 68157440Example 3 host1#dir /incomingunshared infile size size date (UTC) use------------- -------- -------- ------------------- ---disk0:3-0-0a3-7.rel 256 0 12/19/2000 07:14:01disk0:srp.exe 30012312 0 12/19/2000 07:14:12disk0:srpIc.exe 1801208 0 12/19/2000 07:20:32disk0:srpDiag.exe 6984222 0 12/19/2000 07:22:08Disk capacity-------------Capacity Free ReservedDevice (bytes) (bytes) (bytes)------ ---------- --------- --------disk0: 220200960 120616448 36700160Example 4 host1#dir /outgoingunshared infile size size date (UTC) use------------- -------- -------- ------------------- ---disk0:test.scr 1204 0 12/18/2000 03:01:04disk0:foo.scr 1278 1278 12/20/2000 04:02:12Disk capacity-------------Capacity Free ReservedDevice (bytes) (bytes) (bytes)------ ---------- --------- --------disk0: 220200960 120616448 36700160There is no no version. Viewing Files
Use the more command to display the contents of a macro, script, or text file. The file can reside in NVS on the primary SRP module, in NVS on the redundant (standby) SRP module, or on a remote server that you access using FTP.
more
- Use to display the contents of a macro, script, or text file that resides in NVS on the primary SRP module, in NVS on the redundant SRP module, or on a remote server that you access using FTP.
- Specify the file you want to display using one of the following formats, depending on the location of the file:
- fileNameName of the file that resides in NVS on the primary SRP module
- standby:fileNameName of the file that resides in NVS on the redundant (standby) SRP module
- serverName:filePathNameName of the remote server on which the file resides and the complete pathname of the file
- Example 1Displays the contents of a text file named erxconfig.txt that resides in NVS on the primary SRP module
host1#more erxconfig.txtExample 2Displays the contents of a macro file named mysetup.mac that resides in NVS on the redundant (standby) SRP module host1#more standby:mysetup.macExample 3Displays the contents of a script file named myconfig.scr that resides on a remote server named fileserver1 host1#more fileserver1:/startup/scripts/myconfig.scrThere is no no version.