Hello,
Im new to NCM and am trying to write a script to do the following -
show flash: | include bytes free
this will return a line similar to this "15998976 bytes total (8006656 bytes free)" I want to store the "8006656" as an Int variable @FLASH_FREE_SPACE
show flash: | include drwx.*c35
this will return a line similar to this " 9 drwx 128 Mar 1 1993 21:36:17 +00:00 c3550-ipbase-mz.122-40.SE" I want to store the "c3550-ipbase-mz.122-40.SE" as a String variable @IOS_FOLDER
from this I can I then check to see what size the new .TAR IOS file is ? (No idea how to do this) but set it as an Int variable @IOS_SIZE
IF (@FLASH_FREE_SPACE < @IOS_SIZE){
CLI{
copy running-configuration tftp://@TFTP_SERVER/
copy flash:/@IOS_FOLDER tftp://@TFTP_SERVER/
delete /force /recursive @IOS_FOLDER
archive download-sw /overwrite /reload tftp://@TFTP_SERVER/@TFTP_PATH/@NEW_IOS_NAME
}
}
ELSE{
CLI{
copy running-configuration tftp://@TFTP_SERVER/
copy flash:/@IOS_FOLDER tftp://@TFTP_SERVER/
archive download-sw /overwrite /reload tftp://@TFTP_SERVER/@TFTP_PATH/@NEW_IOS_NAME
}
}
Anyone any idea how to do this?