[an error occurred while processing this directive][an error occurred while processing this directive]

Managing Files on Routing Engines in a Routing Matrix with a TX Matrix Plus Router

This topic summarizes key file management issues useful in operating a routing matrix with a TX Matrix Plus router:

Displaying a List of Files

To display a list of files on a Routing Engine in a routing matrix with a TX Matrix Plus router, issue the file list operational management command.

  • To display a list of files on a different chassis, include the chassis specifier (lcc0, lcc1, lcc2, or lcc3) in the directory or file pathname.
  • To display a list of files on a different Routing Engine, include the Routing Engine specifier (re0 or re1) in the directory or file pathname.

The following sample command displays the list of files in the /var/tmp directory on Routing Engine re0 in the line-card chassis lcc0:


user@host> file list lcc0-re0:/var/tmp
lcc0-re0:
--------------------------------------------------------------------------
/var/tmp/:
.gdbinit
.pccardd
Test/
chassisd*
chassisd.nathan*
check_time*
cores/
diagTestPrep*
diagtest*
diagtest.regress*
do_switchovers*
dump_test*
err.manoj.log
esw_clearstats*
esw_counter*
esw_debug*
esw_debug_ge*
esw_filt_test*
esw_filter_tnp_addr*
esw_getstats*
esw_phy*
esw_stats*

Displaying the Contents of a File

To display the contents of a file, issue the file show operational command. To specify a file that is not local to the Routing Engine from which the command is issued, include chassis and Routing Engine information in the filename.

The following sample command displays the contents of the .gdbinit file in the /var/tmp directory on the master Routing Engine of the T1600 router lcc0:


user@host> file show lcc0-re0:/var/tmp/.gdbinit
lcc0-re0:
--------------------------------------------------------------------------
####################################################################
# Settings
####################################################################

set print pretty

####################################################################
# Basic stuff
####################################################################

define msgbuf
        printf "%s", msgbufp->msg_ptr
end
# hex dump of a block of memory
# usage: dump address length
define dump
   p $arg0, $arg1
   set $ch = $arg0
   set $j = 0
   set $n = $arg1
   while ($j < $n)
        #printf "%x %x ",&$ch[$j],$ch[$j]
        printf "%x ",$ch[$j]
        set $j = $j + 1
        if (!($j % 16))
                printf "\n"
        end
   end
end

Copying Files

To copy files from one place to another on the same router or between different routers in the routing matrix, use the file copy operational management command. To specify a file that is not local to the Routing Engine from which the command is issued, include chassis and Routing Engine information in the filename.

The following sample command is used to copy the file sample.txt from the /tmp directory on sfc0-re1 (the backup Routing Engine in the TX Matrix Plus router) to the /var/tmp directory on lcc0-re1 (the backup Routing Engine in one of the connected T1600 routers):


user@host> file copy sfc0-re1:/tmp/sample.txt lcc0-re1:/var/tmp

Renaming Files

To rename a file, use the file rename operational management command. To specify a file that is not local to the Routing Engine from which the command is issued, include chassis and Routing Engine information in the filename.

The following sequence of sample commands lists the files in the /var/tmp directory on sfc0-re0 (the master Routing Engine of the TX Matrix Plus router), renames one of the files (changing dcd.core to dcd.core.990415), and then lists the files in the /var/tmp directory again to show the newly named file:


user@host> file list sfc0-re0:/var/tmp
dcd.core
rpd.core
snmpd.core

user@host> file rename sfc0-re0:/var/tmp/dcd.core /var/tmp/dcd.core.990413
 

user@host> file list sfc0-re0:/var/tmp
dcd.core.990413
rpd.core
snmpd.core 

Deleting Files

To delete a file, use the file delete operational management command. To specify a file that is not local to the Routing Engine from which the command is issued, include chassis and Routing Engine information in the filename.

The following sequence of sample command lists the files in the /var/tmp directory on sfc0-re0 (the master Routing Engine on the TX Matrix Plus router), deletes the file snmpd.core from that directory, and then lists the files in the directory again:


user@host> file list lcc0-re0:/var/tmp
dcd.core
rpd.core
snmpd.core

user@host> file delete lcc0-re0:/var/tmp/snmpd.core

user@host> file list /var/tmp
dcd.core
rpd.core

Published: 2010-04-15

[an error occurred while processing this directive]