cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
534
Views
0
Helpful
4
Replies

Use EEM to delete multiple files from flash

cxu21
Level 1
Level 1

I tried to save running configuration on flash every month, after a while I would like to delete old files, but could not figure out how to do it.

For example, the file name is formated like "month-year-running.txt"(Oct-2022-running.txt), I would like to delete all the files created in last year. I can get year 2023 from show clock command and extract 2023 as a variable, I thought I can  minus 1 to get 2022. It is pretty easy in programming language, but I could not achieve it using EEM.

Can anyone help to give me some hint on this?

4 Replies 4

Leo Laohoo
Hall of Fame
Hall of Fame

Instead of saving the config in the flash, why not save the config somewhere else using TFTP?

Custmoer environment does not have TFTP.


@cxu21 wrote:
Custmoer environment does not have TFTP.


Not an excuse.  

Any small or cheap computing device, like a Raspberry Pi, can be a TFTP server.  In Windows, a TFTP server is easy to install.  In my first networking gig, I stole (yes, stole!) my employer's DL380 and used it as a TFTP server and authentication server.  I found the server sitting in a rack not turned on.  I spent several weeks trying to determine who the owner is.  No one fessed up so it was "mine".  

It is more dangerous having backup stored in a switch or router because if they fail, there goes the config.  

if you saving the information in flash, if the device dead -(ask customer what is the option to replace device ?)

or you can try using email to send that config over to admin email.

but suggest to have backup server always. (our of the box to store the config files incrementally)

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

Review Cisco Networking for a $25 gift card