cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
363
Views
0
Helpful
5
Replies

EEM delete a file from flash

extremum
Level 1
Level 1

Hello ,

I am new with EEM , I want to delete a file from flash with EEM  , how can I do that ?

event manager applet test authorization bypass

Event timer watchdog time 30 maxrun 120

 action 1.0 cli command "enable"

 action 2.0 cli command "delete flash:test.txt"

Router asks ;

 

GW#delete flash:test.txt
Delete filename [test.txt]?

 

How can I send "Enter" with EEM  ?

 

Thanks .

1 Accepted Solution

Accepted Solutions

Dan Frey
Cisco Employee
Cisco Employee

EEM has file management capabilities

 

event manager applet test
 event none
 action 020 file delete bootflash:<filename>

 

View solution in original post

5 Replies 5

M02@rt37
VIP
VIP

Hello @extremum 

Use the file prompt quiet command to disable the IOS confirmation mechanism that asks to confirm a user’s actions.

event manager applet test authorization bypass
event timer watchdog time 30 maxrun 120
action 1.0 cli command "enable"
action 2.0 cli command "configure terminal"
action 3.0 cli command "file prompt quiet"
action 4.0 cli command "end"
action 5.0 cli command "delete flash:test.txt"
action 6.0 cli command "configure terminal"
action 7.0 cli command "no file prompt quiet"

 

Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.

Hello ,

Tried but it still require to confirm . How do I confirm with EEM ?

quietsh run | i quiet
prompt quiet
file prompt quiet
quiet
quietdele
quietdelete bo
quietdelete bootflash:gw
quietdelete bootflash:test.txt
Delete bootflash:/test.txt? [confirm]

Dan Frey
Cisco Employee
Cisco Employee

EEM has file management capabilities

 

event manager applet test
 event none
 action 020 file delete bootflash:<filename>

 

Thanks !

Leo Laohoo
Hall of Fame
Hall of Fame
action 2.0 cli command "delete /force /recursive flash:test.txt"

Review Cisco Networking for a $25 gift card