06-07-2017 03:15 PM
Hi Team,
I trying make an EEM applet for delete one file from my flash if this is reach some limit.
I search the OID and this work fine, but if I reload my router this OID change (the last index of the file).
For this reason, I like first search this OID for this File in the flash and after this delete my file.
Regards
Solved! Go to Solution.
06-08-2017 09:41 AM
Given this output:
Directory of flash0:/c1900-universalk9-mz.SPA.156-2.T.bin
250 -rw- 81042792 Apr 20 2016 16:34:56 -04:00 c1900-universalk9-mz.SPA.156-2.T.bin
I would use:
regexp " +[0-9]+ +-rw- +([0-9]+).*c1900-universalk9-mz.SPA.156-2.T.bin" $_cli_result match size
And the $size variable would give me the size for the c1900-universalk9-mz.SPA.156-2.T.bin file.
06-08-2017 06:50 AM
CLI would work better for this since you can parse the output of "dir" and simply delete the file you want by name.
06-08-2017 08:02 AM
Hi Joe,
I am trying many times to get tu size file from this output but I can't.
You know how I can get the file size from dir flash command?
I need check the file size before delete this
Thank you for your time and help, have a nice day!!!!!
06-08-2017 09:41 AM
Given this output:
Directory of flash0:/c1900-universalk9-mz.SPA.156-2.T.bin
250 -rw- 81042792 Apr 20 2016 16:34:56 -04:00 c1900-universalk9-mz.SPA.156-2.T.bin
I would use:
regexp " +[0-9]+ +-rw- +([0-9]+).*c1900-universalk9-mz.SPA.156-2.T.bin" $_cli_result match size
And the $size variable would give me the size for the c1900-universalk9-mz.SPA.156-2.T.bin file.
06-08-2017 12:40 PM
Hi Joe,
You are a Master. Your answer resolved my issue
Thanks a lot for:
Your help
Monitor and respond.
Your Time
Regards
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide