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.
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:
Files with specific extensions (.iso, .rpm, core.txt, core.gz, .tar, and .tgz) across all file systems
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:
Download the script
Change the script extension from .txt to .py
Copy the script to XR and Admin VMs/LXCs on active and standby RPs on the target device
Execute the script in python environment
The script is nottaking any action on the identified files.
// 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 220.127.116.11 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>