Utilities
This module describes the following utilities:
•Working with SCE Platform Files
•The User Log
Working with SCE Platform Files
The CLI commands include a complete range of file management commands. These commands allow you to create, delete, copy, and display both files and directories
Note Regarding disk capacity: While performing disk operations, the user should take care that the addition of new files that are stored on the SCE disk do not cause the disk to exceed 70%.
•Working with Directories
•Working with Files
Working with Directories
•How to Create a Directory
•How to Delete a Directory
•How to Change Directories
•How to Display your Working Directory
•How to List the Files in a Directory
How to Create a Directory
mkdir
Step 1 From the SCE# prompt, type mkdir directory-name and press Enter.
How to Delete a Directory
There are two different commands for deleting a directory, depending on whether the directory is empty or not.
•How to Delete a Directory and All its Files
•How to Delete an Empty Directory
How to Delete a Directory and All its Files
delete
Step 1 From the SCE# prompt, type delete directory-name /recursive and press Enter.
The recursive flag deletes all files and sub-directories contained in the specified directory.
How to Delete an Empty Directory
rmdir
Step 1 From the SCE# prompt, type rmdir directory-name and press Enter.
Use this command only for an empty directory.
How to Change Directories
Use this command to change the path of the current working directory. cd
Step 1 From the SCE# prompt, type cd new path and press Enter.
How to Display your Working Directory
pwd
Step 1 From the SCE# prompt, type pwd and press Enter.
How to List the Files in a Directory
You can display a listing of all files in the current working directory. This list may be filtered to include only application files. The listing may also be expanded to include all files in any sub-directories.
•How to List the Files in the Current Directory
•How to List the Applications in the Current Directory
•How to Include Files in Sub-Directories in the Directory Files List
How to List the Files in the Current Directory
Step 1 From the SCE# prompt, type dir and press Enter.
How to List the Applications in the Current Directory
Step 1 From the SCE# prompt, type dir applications and press Enter.
How to Include Files in Sub-Directories in the Directory Files List
Step 1 From the SCE# prompt, type dir -r and press Enter.
Working with Files
•How to Rename a File
•How to Delete a File
•Copying Files
•How to Display File Contents
•How to Unzip a File
How to Rename a File
rename
Step 1 From the SCE# prompt, type rename current-file-name new-file-name and press Enter.
How to Delete a File
delete
Step 1 From the SCE# prompt, type delete file-name and press Enter.
Copying Files
You can copy a file from the current directory to a different directory. You can also copy a file (upload/download) to or from an FTP site.
To copy a file using passive FTP, use the copy-passive command.
•How to Copy a File
•How to Download a File from an FTP Site
•How to Upload a File to a Passive FTP Site
How to Copy a File
copy
Step 1 From the SCE# prompt, type copy source-file-name destination-file-name and press Enter.
Copying a File: Example
The following example copies the local analysis.sli file located in the root directory to the applications directory.
SCE#copy analysis.sli applications/analysis.sli
sce#
How to Download a File from an FTP Site
Use the copy command to upload and download commands from and FTP site. In this case, either the source or destination filename must begin with ftp://.
Step 1 From the SCE# prompt, type copy ftp://username:password@ip-address/path:/source-file destination-file-name and press Enter.
To upload a file to an FTP site, specify the FTP site as the destination (ftp://username:password@ip-address/path:/destination-file)
How to Upload a File to a Passive FTP Site
Step 1 From the SCE# prompt, type copy-passive source-file-name ftp:/username:password@10.10.10.10/h:/destination-file and press Enter.
To download a file from a passive FTP site, specify the FTP site as the source (ftp://username:password@ip-address/path:/source-file)
Uploading a File to a Passive FTP Site: Example
The following example uploads the analysis.sli file located on the local flash file system to the host 10.1.1.1, specifying Passive FTP.
SCE#copy-passive /appli/analysis.sli ftp://myname:mypw@10.1.1.1/p:/appli/analysis.sli
sce#
How to Display File Contents
Step 1 From the SCE# prompt, type more file-name and press Enter.
How to Unzip a File
Step 1 From the SCE# prompt, type unzip file-name and press Enter.
The User Log
The user log is an ASCII file that can be viewed in any editor. It contains a record of system events, including startup, shutdown and errors. You can use the Logger to view the user log to determine whether or not the system is functioning properly, as well as for technical support purposes.
•The Logging System
•Generating a File for Technical Support
The Logging System
•Copying the User Log
•Enabling and Disabling the User Log
•Viewing the User Log Counters
•Viewing the User Log
•Clearing the User Log
Events are logged to one of two log files. After a file reaches maximum capacity, the events logged in that file are then temporarily archived. New events are then automatically logged to the alternate log file. When the second log file reaches maximum capacity, the system then reverts to logging events to the first log file, thus overwriting the temporarily archived information stored in that file.
Basic operations include:
•Copying the User Log to an external location
•Viewing the User Log
•Clearing the User Log
•Viewing/clearing the User Log counters
Copying the User Log
You can view the log file by copying it to an external location or to disk. This command copies both log files to the local SCE platform disk or any external host running a FTP server.
•Copying the User Log to an External Location
•Copying the User Log to an Internal Location
Copying the User Log to an External Location
Step 1 From the SCE# prompt, type logger get user-log file-name ftp://username:password@ipaddress/path and press Enter.
Copying the User Log to an Internal Location
Step 1 From the SCE# prompt, type logger get user-log file-name target-filename and press Enter.
Enabling and Disabling the User Log
By default, the user log is enabled. You can disable the user log by configuring the status of the logger.
•Disabling the User Log
•Enabling the User Log
Disabling the User Log
Step 1 From the SCE# prompt, type configure
and press Enter.
Step 2 From the SCE (config)# prompt, type logger device User-File-Log disabled and press Enter.
Enabling the User Log
Step 1 From the SCE# prompt, type configure
and press Enter.
Step 2 From the SCE (config)# prompt, type logger device User-File-Log enabled and press Enter.
Viewing the User Log Counters
•Viewing the user log counters for the current session
•Viewing the non-volatile counter for the user-file-log
There are two types of log counters:
•User log counters — count the number of system events logged from the SCE platform last reboot.
•Non-volatile counters — are not cleared during boot time
Viewing the user log counters for the current session
Step 1 From the SCE# prompt, type show logger device user-file-log counters and press Enter.
Viewing the non-volatile counter for the user-file-log
Step 1 From the SCE# prompt, type show logger device user-file-log nv-counters and press Enter.
Viewing the User Log
Note This command is not recommended when the user log is large. Copy a large log to a file to view it (see Copying the User Log)
Step 1 From the SCE# prompt, type more user-log and press Enter.
Clearing the User Log
Step 1 From the SCE# prompt, type clear logger device user-file-log
and press Enter.
Step 2 The system asks Are you sure?
Step 3 Type Y and press Enter.
Generating a File for Technical Support
In order for technical support to be most effective, the user should provide them with the information contained in the system logs. Use the logger get support-file command to generate a support file via FTP for the use of Cisco technical support staff.
Step 1 From the SCE# prompt, type logger get support-file filename and press Enter.
The support information file is created using the specified filename. The specified file must be a file located on an FTP site, not on the local file system.
This operation may take some time.
Generating a File for Technical Support: Example
SCE# logger get support-file ftp://user:1234@10.10.10.10/c:/support.zip