Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation
Guide That Contains This Content
[+] Expand All
[-] Collapse All

    File Management

    This topic describes the following:

    File Management Overview

    You are responsible for file management. Table 1 shows the types of system files and their corresponding extensions.

    Table 1: Types of System Files and Corresponding Extensions

    Type of File

    Extension

    Description

    Configuration

    *.cnf

    Snapshot of the system’s configuration

    Core dump

    *.dmp

    File you can create for troubleshooting if a module fails

    History

    *.hty (reboot.hty)

    Details of when and why modules rebooted

    Log

    *.log

    A series of messages that describe events that occurred on the system

    Macro

    *.mac

    A macro program

    Release

    *.rel

    Software releases you can install in the system

    Script

    *.scr

    A sequence of CLI commands. When you run a script file, the system executes the commands as though they were entered at the terminal

    Secure Shell (SSH) Server public key

    *.pub

    Host key for the SSH server

    Statistics

    *.sts

    Bulk statistics created when you run the bulkstats commands

    Text

    *.txt

    Text file

    System files may reside in four locations:

    • The system space
    • The user space
    • A network host
    • The standby switch route processor (SRP) module

    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:

    • /incoming—Read-write directory to and from which an FTP client can send and retrieve files.
    • /outgoing—Read-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 nonvolatile storage (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.

    FTP Commands for Managing the User Space from a Network Host

    If you enable the system’s FTP server (see FTP Server), you can manage files on the user space from an FTP client on a network host. Table 2 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.

    Table 2: FTP Commands That the System Supports

    FTP Command

    Function

    HELP

    List supported commands.

    USER

    Verify username.

    PASS

    Verify password for the user.

    QUIT

    Quit the session.

    LIST

    List contents of a directory.

    NLST

    List directory contents using a concise format.

    RETR

    Retrieve a file.

    STOR

    Store a file.

    CWD

    Change working directory.

    CDUP

    Change working directory to parent.

    TYPE

    Change the data representation type.

    PORT

    Change the port number.

    PWD, XPWD

    Get the name of current working directory.

    STRU

    Change file structure settings (only stream mode supported).

    MODE

    Change file transfer mode (only stream mode supported).

    PASV

    Make the server listen on a port for data connection.

    NOOP

    Do nothing.

    DELE

    Delete a file.

    MKD, XMKD

    Make directory.

    RMD, XRMD

    Remove directory.

    RNFR

    Rename from.

    RNTO

    Rename to.

    File Commands and FTP Servers Overview

    Commands—copy, configure file, and macro—that 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 Local Files

    To rename files, you can use the rename command. Table 3 shows the types of files you can rename in different locations.

    Table 3: File Types You Can Rename

     

    Destination

    Source

    System Space

    User Space

    (Linked Files and Unlinked Files)

    Network Host Within a Firewall

    Standby SRP Module

    System

    *.cnf

    *.dmp

    *.hty

    *.log

    *.mac

    *.rel

    *.scr

    *.txt

    Nonsystem files

    *.cnf

    *.dmp

    *.hty

    *.log

    *.mac

    *.scr

    *.txt

    *.sts

    None

    User Space

    *.cnf

    *.hty (excluding reboot.hty)

    *.log (excluding system.log)

    *.mac

    *.scr

    *.txt

    *.cnf

    *.dmp

    *.hty

    *.log

    *.mac

    *.pub

    *.rel

    *.scr

    *.sts

    *.txt

    Nonsystem files

    None

    None

    Network Host Within a Firewall

    None

    None

    None

    None

    Standby SRP Module

    None

    None

    None

    None

    To rename a local file:

    • Issue the rename command in Privileged Exec mode.
      host1#rename boston1.cnf boston2.cnf

      Note: You can change the base name but not the extension of a file.

    Deleting Files in Nonvolatile Storage

    You can use the delete command to delete files in NVS. Table 4 shows the types of files you can delete in different locations.

    Table 4: File Types You Can Delete

    Location

    System Space

    User Space

    (Linked Files and Unlinked Files)

    Network Host Within a Firewall

    Standby SRP Module

    *.cnf

    *.dmp

    *.hty

    *.log

    *.mac

    *.rel

    *.scr

    *.sts

    *.txt

    *.cnf

    *.dmp

    *.hty

    *.log

    *.mac

    *.pub

    *.rel
    (deletes *.rel file only and not associated files)

    *.scr

    *.sts

    *.txt

    Nonsystem files

    None

    *.dmp

    To delete files in NVS:

    • 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.
      host1#delete /outgoing/test.scr
    • Delete multiple local files using an asterisk (*) as a wildcard. 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.
      host1#del test*.txt Delete 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 files

      Note: You cannot delete reboot.hty or system.log files when you use a wildcard.

    • Delete a specific local file. When you do not use a wildcard, the CLI deletes the file immediately without prompting you for confirmation.
      host1#delete test-2.txt host1#
    • Delete multiple local files without confirmation from the user. Use the force keyword along with the wildcard to perform deletion 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.
      host1#del test*.txt force disk0:test-1.txt: deleteddisk0:test-2.txt: deletedDeleted 2 files, matched 2 files
      host1#del *.dmp force WARNING: 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 files

      Note: 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.

    Published: 2014-08-12