cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
860
Views
15
Helpful
0
Comments
Aleksandar Vidakovic
Cisco Employee
Cisco Employee

Introduction

This document and the accompanying script helps users of 64-bit IOS XR identify unnecessary files on file systems, that can lead over time to disk space shortage. A high number of showtechs or coredumps, SW packages copied to a disk are some of the well known contributors to disk space depletion.

Solution

The script contained in this document is identifying commonly seen large files that are not required for the proper functioning of the system. Such files can should be copied to a file server and afterwards deleted from the device. This script can be used on ASR 9000 (64-bit only), NCS5500, NCS5000, NCS540, NCS560 devices.

 

Script is using the following criteria to identify potentially unnecessary files:

 

  1. Files with specific extensions (.iso, .rpm, core.txt, core.gz, .tar, and .tgz) across all file systems
  2. Any files in folders used for collecting troubleshooting information (/disk0:/core, harddisk:/dumper, and harddisk:/showtech in XR VM)

The script auto-detects whether it's executed within XR or Admin VM/LXC.

Working With The Script 

Script source code is attached to this document. Working with the script is very simple:

 

  1. Download the script
  2. Change the script extension from .txt to .py
  3. Copy the script to XR and Admin VMs/LXCs on active and standby RPs on the target device
  4. Execute the script in python environment

The script is not taking any action on the identified files.

Example

 

// Copy file from file server to active RP's XR VM
RP/0/RSP0/CPU0:CORE-TOP#copy ftp://<username>:<password>@@10.86.188.49/712/find_unnecessary_files.py harddisk
Destination filename [/harddisk:/find_unnecessary_files.py]?
Accessing ftp://<username>:*@10.86.188.49/712/find_unnecessary_files.py
C
10695 bytes copied in 0 sec

Copy operation success

// Execute script in active RP's XR VM:
RP/0/RSP0/CPU0:CORE-TOP#run python /misc/disk1/find_unnecessary_files.py
<output omitted>

// Copy script to active RP's Admin VM:
RP/0/RSP0/CPU0:CORE-TOP#admin
root connected from 192.0.16.4 using ssh on sysadmin-vm:0_RSP0
sysadmin-vm:0_RSP0# copy harddisk:/find_unnecessary_files.py location 0/RSP0/CPU0/VM1 harddisk: location 0/RSP0
Copying harddisk:/find_unnecessary_files.py to harddisk:
File copied successfully

//
Execute script in active RP's Admin VM:
sysadmin-vm:0_RSP0# run python /misc/disk1/find_unnecessary_files.py
<output omitted>

 

 

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Recognize Your Peers
Quick Links